Download source/scripts/download_candidate.py from andyshu/opensysone: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/andyshu/opensysone/resolve/main/source/scripts/download_candidate.py
- Command line
-
hf download hf://andyshu/opensysone/source/scripts/download_candidate.py
-
curl -L -o download_candidate.py https://huggingface.co/andyshu/opensysone/resolve/main/source/scripts/download_candidate.py
1.14 kB
| """Sequential pinned candidate download, separate from the immutable smoke base.""" | |
| import argparse | |
| import json | |
| import os | |
| from pathlib import Path | |
| os.environ["HF_HUB_DISABLE_XET"] = "1" | |
| from huggingface_hub import snapshot_download | |
| MODELS = { | |
| "Qwen/Qwen3.5-2B": "15852e8c16360a2fea060d615a32b45270f8a8fc", | |
| "Qwen/Qwen3-4B-Instruct-2507": "cdbee75f17c01a7cc42f958dc650907174af0554", | |
| } | |
| if __name__ == "__main__": | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("--model", choices=list(MODELS), default="Qwen/Qwen3.5-2B") | |
| args = parser.parse_args() | |
| model_id, revision = args.model, MODELS[args.model] | |
| destination = Path.home() / "ai/models/opensysone" / f"{model_id.split('/')[-1]}-{revision[:8]}" | |
| snapshot_download(model_id, revision=revision, local_dir=destination, max_workers=1, | |
| allow_patterns=["*.json", "*.safetensors", "*.txt", "*.jinja", "LICENSE", "README.md"]) | |
| (destination / "opensysone-provenance.json").write_text(json.dumps({ | |
| "model_id": model_id, "revision": revision, "license": "apache-2.0", | |
| }, indent=2) + "\n") | |
| print(destination, flush=True) | |