utilities / fork-a-repo.py
ariG23498's picture
ariG23498 HF Staff
Create fork-a-repo.py
a578dcc verified
Raw History Blame Contribute Delete
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",
)