Use upload_large_folder (#1193)

This commit is contained in:
Pedro Cuenca 2025-01-07 18:18:31 +01:00 committed by GitHub
parent 9183fe8b6d
commit b8f0cacfa8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -673,12 +673,10 @@ def upload_to_hub(path: str, upload_repo: str, hf_path: str):
api = HfApi() api = HfApi()
api.create_repo(repo_id=upload_repo, exist_ok=True) api.create_repo(repo_id=upload_repo, exist_ok=True)
api.upload_folder( api.upload_large_folder(
folder_path=path, folder_path=path,
repo_id=upload_repo, repo_id=upload_repo,
repo_type="model", repo_type="model",
multi_commits=True,
multi_commits_verbose=True,
) )
print(f"Upload successful, go to https://huggingface.co/{upload_repo} for details.") print(f"Upload successful, go to https://huggingface.co/{upload_repo} for details.")