| #!/bin/bash |
| |
| |
| |
| |
| |
| set -uo pipefail |
| pip install -q "transformers==4.46.2" "huggingface_hub<1.0" "datasets<4" "accelerate" 2>&1 | tail -1 |
| python -c " |
| from huggingface_hub import snapshot_download |
| snapshot_download('ashishk1331/ccd-repro-code', repo_type='dataset', local_dir='/work')" |
| cd /work && mkdir -p outputs |
| python - <<'PY' || exit 1 |
| import torch, sys |
| if not torch.cuda.is_available(): print("ABORT: no CUDA"); sys.exit(1) |
| try: |
| (torch.zeros(8,8,device="cuda",dtype=torch.bfloat16) @ |
| torch.zeros(8,8,device="cuda",dtype=torch.bfloat16)).cpu() |
| except Exception as e: |
| print(f"ABORT: GPU unusable: {e}"); sys.exit(1) |
| print(f"GPU OK: {torch.cuda.get_device_name(0)}") |
| PY |
| push () { |
| python - <<'PY' 2>&1 | tail -1 || true |
| from huggingface_hub import HfApi |
| HfApi().upload_folder(folder_path="outputs", path_in_repo="outputs", |
| repo_id="ashishk1331/ccd-repro-results", repo_type="dataset") |
| print("pushed") |
| PY |
| } |
| for m in baseline ccd; do |
| echo "=========== RUN ext $m (problems 32..63) ===========" |
| python scripts/run_eval.py --task humaneval --method $m --limit 32 --offset 32 \ |
| --temperature 0.0 --top-p 0.9 --out "outputs/c4ext_he_${m}.json" || echo "FAILED $m" |
| push |
| done |
| echo "=================== HE EXT DONE ===================" |
|
|