NEXORA / scripts /download_model.py
devildasdf's picture
Release validated NEXORA research prototype, tiny weights and evidence
12496fc verified
Raw History Blame Contribute Delete
943 Bytes
"""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()