B111ue commited on
Commit
a2bb738
·
verified ·
1 Parent(s): 8fe6752

Upload strict640x480-v2/code/run_formal_strict_task.sh with huggingface_hub

Browse files
strict640x480-v2/code/run_formal_strict_task.sh CHANGED
@@ -5,8 +5,19 @@ task="$1"; gpu="$2"; seed_start="$3"
5
  root="/workspace/RoboFactory/runs/strict640x480_v2/$task"
6
  workers="${FORMAL_WORKERS:-4}"
7
  export CUDA_VISIBLE_DEVICES="$gpu" OMP_NUM_THREADS=4 MKL_NUM_THREADS=4
8
- /bin/bash /workspace/act_liftbarrier/run_strict_task_collection.sh "$task" "$gpu" 100 "$root" "$seed_start" "$workers"
9
- /workspace/venvs/robofactory-act/bin/python /workspace/act_liftbarrier/audit_strict640x480_corpus.py \
10
- --task "$task" --data "$root/*.h5" --expected-episodes 100 --output "$root/strict_audit.json"
11
- export HF_TOKEN="$(cat /workspace/.hf_dinov3_token)"
 
 
 
 
 
 
 
 
 
 
12
  /workspace/venvs/robofactory-act/bin/python /workspace/act_liftbarrier/upload_strict_task_hf.py --task "$task" --source "$root"
 
 
5
  root="/workspace/RoboFactory/runs/strict640x480_v2/$task"
6
  workers="${FORMAL_WORKERS:-4}"
7
  export CUDA_VISIBLE_DEVICES="$gpu" OMP_NUM_THREADS=4 MKL_NUM_THREADS=4
8
+ audit_glob="${root}/*.h5"
9
+ audit=(/workspace/venvs/robofactory-act/bin/python /workspace/act_liftbarrier/audit_strict640x480_corpus.py
10
+ --task "$task" --data "$audit_glob" --expected-episodes 100 --output "$root/strict_audit.json")
11
+ # Make recovery idempotent: a completed, valid corpus must be audited and
12
+ # uploaded rather than needlessly recollected after a transient upload failure.
13
+ if ! "${audit[@]}"; then
14
+ rm -f "$root/strict_audit.json"
15
+ /bin/bash /workspace/act_liftbarrier/run_strict_task_collection.sh "$task" "$gpu" 100 "$root" "$seed_start" "$workers"
16
+ "${audit[@]}"
17
+ fi
18
+ token_file=/workspace/.hf_dinov3_token
19
+ [[ -r "$token_file" ]] || { echo "missing Hugging Face upload credential" >&2; exit 1; }
20
+ # Read the credential as data (not by sourcing the file); strip only line endings.
21
+ export HF_TOKEN="$(tr -d '\r\n' < "$token_file")"
22
  /workspace/venvs/robofactory-act/bin/python /workspace/act_liftbarrier/upload_strict_task_hf.py --task "$task" --source "$root"
23
+ unset HF_TOKEN