File size: 1,141 Bytes
2d5c26a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""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)