#!/usr/bin/env python3 | |
from huggingface_hub import HfApi | |
import sys | |
api = HfApi() | |
folder = sys.argv[1] | |
repo = sys.argv[2] | |
# Upload all the content from the local folder to your remote Space. | |
# By default, files are uploaded at the root of the repo | |
api.upload_folder( | |
folder_path=folder, | |
repo_id=repo, | |
path_in_repo="./", | |
delete_patterns="*.git*", # Delete all remote text files before | |
create_pr=True, | |
commit_message="Add diffusers weights" | |
) | |