Download scripts/fetch_ckpts.py from Cross-Mergeability/crossarch-1b-diagnostics: direct link, hf CLI and curl.
- Browser
- Download file 987 Bytes
-
https://huggingface.co/datasets/Cross-Mergeability/crossarch-1b-diagnostics/resolve/main/scripts/fetch_ckpts.py
- Command line
-
hf download hf://datasets/Cross-Mergeability/crossarch-1b-diagnostics/scripts/fetch_ckpts.py
-
curl -L -o fetch_ckpts.py https://huggingface.co/datasets/Cross-Mergeability/crossarch-1b-diagnostics/resolve/main/scripts/fetch_ckpts.py
987 Bytes
| import sys, os, traceback | |
| from huggingface_hub import snapshot_download, HfApi | |
| api = HfApi() | |
| PYTHIA_STEPS = [1,128,512,1000,2000,4000,8000,16000,32000,64000,96000,128000,143000] | |
| ZH_STEPS = [1000,5000,10000,20000,40000,60000,80000,90000] | |
| JOBS = [("EleutherAI/pythia-1.4b", f"step{s}") for s in PYTHIA_STEPS] + \ | |
| [("SJTU-CL/Zh-Pythia-1.4B", f"checkpoint-{s}") for s in ZH_STEPS] | |
| shard = int(sys.argv[1]); nshard = int(sys.argv[2]) | |
| for k,(rid,rev) in enumerate(JOBS): | |
| if k % nshard != shard: continue | |
| try: | |
| files = set(api.list_repo_files(rid, revision=rev)) | |
| if "pytorch_model.bin" in files: | |
| pats = ["*.json","pytorch_model.bin"] | |
| else: | |
| pats = ["*.json","*.safetensors"] | |
| p = snapshot_download(rid, revision=rev, allow_patterns=pats, max_workers=3) | |
| print("OK", rid, rev, flush=True) | |
| except Exception as e: | |
| print("FAIL", rid, rev, repr(e)[:200], flush=True) | |
| print("SHARDDONE", shard, flush=True) | |