patrickvonplaten
commited on
Commit
·
912b6df
1
Parent(s):
4e219d9
up
Browse files- upload_folder.py +20 -0
upload_folder.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env python3
|
2 |
+
from huggingface_hub import HfApi
|
3 |
+
import sys
|
4 |
+
|
5 |
+
api = HfApi()
|
6 |
+
|
7 |
+
|
8 |
+
folder = sys.argv[1]
|
9 |
+
repo = sys.argv[2]
|
10 |
+
|
11 |
+
# Upload all the content from the local folder to your remote Space.
|
12 |
+
# By default, files are uploaded at the root of the repo
|
13 |
+
api.upload_folder(
|
14 |
+
folder_path=folder,
|
15 |
+
repo_id=repo,
|
16 |
+
path_in_repo="./",
|
17 |
+
delete_patterns="*.git*", # Delete all remote text files before
|
18 |
+
create_pr=True,
|
19 |
+
commit_message="Add diffusers weights"
|
20 |
+
)
|