File size: 772 Bytes
31e2456
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
# Wait for the next .pt checkpoint to appear under <run_dir>, then run probe.
# Usage: probe_when_ready.sh <run_dir> <model_letter> <ptbxl_npz> <out_json>
set -euo pipefail
RUN_DIR="${1:?run_dir}"
MODEL="${2:?model letter A|B|C|F}"
PTBXL="${3:?ptbxl npz path}"
OUT="${4:?output json}"

echo "[probe] waiting for ckpt in $RUN_DIR"
while :; do
  CKPT=$(ls -t "$RUN_DIR"/*.pt 2>/dev/null | head -1 || true)
  if [ -n "$CKPT" ] && [ -f "$PTBXL" ]; then
    echo "[probe] ckpt=$CKPT, ptbxl=$PTBXL — running"
    cd /workspace/PhysioJEPA
    PYTHONPATH=src /usr/bin/python3 -u scripts/eval_checkpoint.py \
      --ckpt "$CKPT" --model "$MODEL" --ptbxl_npz "$PTBXL" --out "$OUT"
    echo "[probe] done -> $OUT"
    cat "$OUT"
    break
  fi
  sleep 10
done