Datasets:
Download code/fetch_models.py from spatial-evidence-bench/SpatialEvidenceBench: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/datasets/spatial-evidence-bench/SpatialEvidenceBench/resolve/5c8b07c8e3679dc7d2dd54b6fae5e27f9d82c4db/code/fetch_models.py
- Command line
-
hf download hf://datasets/spatial-evidence-bench/SpatialEvidenceBench@5c8b07c8e3679dc7d2dd54b6fae5e27f9d82c4db/code/fetch_models.py
-
curl -L -o fetch_models.py https://huggingface.co/datasets/spatial-evidence-bench/SpatialEvidenceBench/resolve/5c8b07c8e3679dc7d2dd54b6fae5e27f9d82c4db/code/fetch_models.py
1.16 kB
| import json | |
| import os | |
| import sys | |
| import traceback | |
| from pathlib import Path | |
| from huggingface_hub import snapshot_download | |
| REPOS = [ | |
| ("HuggingFaceM4/Idefics3-8B-Llama3", "Idefics3-8B-Llama3"), | |
| ("OpenGVLab/InternVL3-9B-Instruct", "InternVL3-9B-Instruct"), | |
| ("allenai/Molmo-7B-D-0924", "Molmo-7B-D-0924"), | |
| ] | |
| root = Path("/repository/models") | |
| log = Path("n_full_v1/assets/model_download.log") | |
| if not log.parent.exists(): | |
| log = Path("/mnt/f70f6709-366e-49a0-861f-497645d98975/lyz/GraphEvolve/n_full_v1/assets/model_download.log") | |
| with log.open("a", encoding="utf-8") as fh: | |
| for repo, name in REPOS: | |
| target = root / name | |
| fh.write(f"START {repo} -> {target}\n") | |
| fh.flush() | |
| try: | |
| path = snapshot_download( | |
| repo_id=repo, | |
| local_dir=str(target), | |
| local_dir_use_symlinks=False, | |
| max_workers=8, | |
| resume_download=True, | |
| ) | |
| fh.write(f"DONE {repo} {path}\n") | |
| except Exception: | |
| fh.write(f"FAIL {repo}\n{traceback.format_exc()}\n") | |
| fh.flush() | |
| fh.write("ALL_DONE\n") | |
| print("ALL_DONE") | |