Download scripts/download_models.py from ChatterjeeLab/PepPA: direct link, hf CLI and curl.
- Browser
- Download file 877 Bytes
-
https://huggingface.co/ChatterjeeLab/PepPA/resolve/main/scripts/download_models.py
- Command line
-
hf download hf://ChatterjeeLab/PepPA/scripts/download_models.py
-
curl -L -o download_models.py https://huggingface.co/ChatterjeeLab/PepPA/resolve/main/scripts/download_models.py
877 Bytes
| """Download selected pinned artifacts. Does not download weights by default.""" | |
| import argparse,json | |
| from pathlib import Path | |
| def main(): | |
| p=argparse.ArgumentParser();p.add_argument('component');p.add_argument('--destination',required=True);p.add_argument('--weights',action='store_true');a=p.parse_args() | |
| from huggingface_hub import snapshot_download | |
| registry=json.loads((Path(__file__).resolve().parents[1]/'configs/model_registry.json').read_text()) | |
| x=registry[a.component] | |
| if not x.get('revision'):raise ValueError('resolve and freeze a revision before downloading this component') | |
| snapshot_download(repo_id=x['repo_id'],repo_type=x.get('repo_type','model'),revision=x['revision'],local_dir=a.destination, | |
| allow_patterns=None if a.weights else ['*.py','*.json','*.yaml','*.yml','*.txt','*.md','*.toml','*.sh']) | |
| if __name__=='__main__':main() | |