Download fork-a-repo.py from ariG23498/utilities: direct link, hf CLI and curl.
- Browser
- Download file 290 Bytes
-
https://huggingface.co/datasets/ariG23498/utilities/resolve/main/fork-a-repo.py
- Command line
-
hf download hf://datasets/ariG23498/utilities/fork-a-repo.py
-
curl -L -o fork-a-repo.py https://huggingface.co/datasets/ariG23498/utilities/resolve/main/fork-a-repo.py
290 Bytes
| from huggingface_hub import snapshot_download | |
| from huggingface_hub import HfApi | |
| path = snapshot_download(repo_id="org/model") | |
| api = HfApi() | |
| api.create_repo(repo_id="new-org/model", private=True) | |
| api.upload_folder( | |
| folder_path=path, | |
| repo_id="new-org/model", | |
| repo_type="model", | |
| ) |