| # Resume on a fresh GPU: pull code + data + latest checkpoint from your private HF repos. | |
| # Usage: resume.sh <hf_token> [checkpoint_subdir] e.g. resume.sh hf_xxx checkpoint-800 | |
| set -uo pipefail | |
| export HF_TOKEN="${1:?usage: resume.sh <hf_token> [checkpoint]}" | |
| CKPT="${2:-}" | |
| export HF_HOME=/workspace/hf-cache HF_HUB_CACHE=/workspace/hf-cache/hub PIP_BREAK_SYSTEM_PACKAGES=1 | |
| mkdir -p /workspace/infosec/data/processed /workspace/infosec/checkpoints | |
| cd /workspace/infosec | |
| echo "== code from HF (adhikjoshi/infosec-v1:code/) ==" | |
| hf download adhikjoshi/infosec-v1 --include "code/**" --repo-type model --local-dir /workspace/_codedl 2>&1 | tail -1 | |
| cp -r /workspace/_codedl/code/* /workspace/infosec/ 2>/dev/null || true | |
| echo "== v2 training data from HF ==" | |
| hf download adhikjoshi/infosec-training-data v2/v2_train.chatml.jsonl v2/v2_val.chatml.jsonl --repo-type dataset --local-dir /workspace/_datadl 2>&1 | tail -1 | |
| cp /workspace/_datadl/v2/*.jsonl /workspace/infosec/data/processed/ 2>/dev/null || true | |
| if [ -n "$CKPT" ]; then | |
| echo "== checkpoint $CKPT from HF ==" | |
| hf download adhikjoshi/infosec-v1 --include "$CKPT/**" --repo-type model --local-dir /workspace/infosec/checkpoints 2>&1 | tail -1 | |
| fi | |
| echo "resume complete: code + data ${CKPT:+(+ $CKPT)} pulled. Next: bash training/scripts/remote/bootstrap.sh" | |