File size: 943 Bytes
12496fc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""Download an upstream model at a recorded immutable revision via the hf CLI."""
from pathlib import Path
import argparse
import json
import subprocess


def main():
    p = argparse.ArgumentParser()
    p.add_argument("--repo", default="Qwen/Qwen3.5-0.8B")
    args = p.parse_args()
    sources = json.loads(Path("reports/sources.json").read_text())["models"]
    found = next((x for x in sources if x["repo"] == args.repo), None)
    if found is None:
        raise ValueError("Model must be recorded in reports/sources.json first")
    target = Path(".cache") / args.repo.split("/")[-1]
    subprocess.run(["hf", "download", args.repo, "--revision", found["revision"], "--local-dir", str(target),
                    "--include", "*.json", "--include", "*.safetensors", "--include", "*.txt", "--include", "*.jinja",
                    "--include", "LICENSE", "--include", "README.md"], check=True)


if __name__ == "__main__":
    main()