summaryrefslogtreecommitdiff
path: root/sync_and_run.sh
diff options
context:
space:
mode:
authorVoid Agent <void@jayrup.hermes>2026-07-29 17:42:47 +0100
committerVoid Agent <void@jayrup.hermes>2026-07-29 17:42:47 +0100
commit66f99ee30087a5f28ad852e581a0334c7f556091 (patch)
treeb83da26e340a926e6eb46f1b304b66f693a15e81 /sync_and_run.sh
Initial project setup: J-lens implementation for nanoGPT
- Core J-lens computation (batched per-layer, per-token gradient method) - Project README with background and experiment plan - Sync script for meru Docker container deployment - Upstream nanoGPT model code copied to src/ Architecture: Computes d(log_p(token))/d(residual_stream) averaged over corpus contexts, replicating Anthropic's Jacobian Lens technique.
Diffstat (limited to 'sync_and_run.sh')
-rwxr-xr-xsync_and_run.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/sync_and_run.sh b/sync_and_run.sh
new file mode 100755
index 0000000..b716f32
--- /dev/null
+++ b/sync_and_run.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+# Sync code from voidlaptop to meru's jspace container and run commands
+# Usage: ./sync_and_run.sh [command or "shell"]
+
+set -e
+
+MACHINE="meru"
+CONTAINER="jspace-nanogpt"
+REMOTE_CODE="/mnt/appdata/jspace/code"
+LOCAL_PROJECT="$HOME/projects/jspace-nanogpt"
+
+echo "=== Syncing code to $MACHINE ==="
+rsync -avz --delete \
+ --exclude='upstream-nanogpt' \
+ --exclude='.git' \
+ --exclude='__pycache__' \
+ --exclude='*.pyc' \
+ --exclude='outputs/*' \
+ --exclude='data/*' \
+ "${LOCAL_PROJECT}/" \
+ "${MACHINE}:${REMOTE_CODE}/"
+
+if [ "$1" = "shell" ]; then
+ echo "=== Opening shell in container ==="
+ ssh -t "$MACHINE" "docker exec -it $CONTAINER bash"
+elif [ -n "$1" ]; then
+ echo "=== Running: $@ ==="
+ ssh "$MACHINE" "docker exec $CONTAINER bash -c 'cd /workspace/code && $*'"
+else
+ echo "=== Synced. No command specified. ==="
+ echo "Usage: $0 shell # interactive bash"
+ echo " $0 'command ...' # run a command"
+fi