Spaces:
Sleeping
Sleeping
Upload upl.py with huggingface_hub
Browse files
upl.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import os
|
|
|
|
| 2 |
from huggingface_hub import HfApi, HfFolder
|
| 3 |
|
| 4 |
def upload_folder_to_hf_space(repo_id, folder_path, token=None):
|
|
@@ -17,6 +18,7 @@ def upload_folder_to_hf_space(repo_id, folder_path, token=None):
|
|
| 17 |
remote_path = os.path.relpath(local_path, folder_path)
|
| 18 |
|
| 19 |
print(f"Uploading {local_path} to {repo_id}/{remote_path}...")
|
|
|
|
| 20 |
api.upload_file(
|
| 21 |
path_or_fileobj=local_path,
|
| 22 |
path_in_repo=remote_path,
|
|
|
|
| 1 |
import os
|
| 2 |
+
import time
|
| 3 |
from huggingface_hub import HfApi, HfFolder
|
| 4 |
|
| 5 |
def upload_folder_to_hf_space(repo_id, folder_path, token=None):
|
|
|
|
| 18 |
remote_path = os.path.relpath(local_path, folder_path)
|
| 19 |
|
| 20 |
print(f"Uploading {local_path} to {repo_id}/{remote_path}...")
|
| 21 |
+
time.sleep(2)
|
| 22 |
api.upload_file(
|
| 23 |
path_or_fileobj=local_path,
|
| 24 |
path_in_repo=remote_path,
|