Download scripts/push_hf.py from baicai1145/g2pS: direct link, hf CLI and curl.
- Browser
- Download file 489 Bytes
-
https://huggingface.co/baicai1145/g2pS/resolve/main/scripts/push_hf.py
- Command line
-
hf download hf://baicai1145/g2pS/scripts/push_hf.py
-
curl -L -o push_hf.py https://huggingface.co/baicai1145/g2pS/resolve/main/scripts/push_hf.py
489 Bytes
| """Upload weights to HF. Usage: HF_TOKEN=hf_xxx python scripts/push_hf.py""" | |
| import os, sys | |
| from huggingface_hub import HfApi | |
| repo = sys.argv[1] if len(sys.argv) > 1 else 'baicai-1145/g2pS' | |
| api = HfApi(token=os.environ['HF_TOKEN']) | |
| api.create_repo(repo, repo_type='model', exist_ok=True) | |
| api.upload_large_folder(repo_id=repo, repo_type='model', folder_path='.', | |
| ignore_patterns=['.git/*', 'training/*', 'scripts/*', 'examples/*', 'g2ps/*']) | |
| print('uploaded', repo) | |