Download code/dl.py from Sandy-sys/aditi-ps18-state: direct link, hf CLI and curl.
- Browser
- Download file 441 Bytes
-
https://huggingface.co/Sandy-sys/aditi-ps18-state/resolve/main/code/dl.py
- Command line
-
hf download hf://Sandy-sys/aditi-ps18-state/code/dl.py
-
curl -L -o dl.py https://huggingface.co/Sandy-sys/aditi-ps18-state/resolve/main/code/dl.py
441 Bytes
| import os, sys, time | |
| os.environ.setdefault("HF_HOME","/workspace/.hf_home") | |
| from huggingface_hub import snapshot_download | |
| repo, dest = sys.argv[1], sys.argv[2] | |
| allow = sys.argv[3].split(",") if len(sys.argv)>3 else None | |
| t=time.time() | |
| p=snapshot_download(repo_id=repo, local_dir=dest, allow_patterns=allow, | |
| max_workers=16, token=os.environ.get("HF_TOKEN")) | |
| print(f"DONE {repo} -> {p} in {time.time()-t:.0f}s", flush=True) | |