Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ def upload_file_to_hub(file_path, repo_id, path_in_repo, repo_type, commit_mess
|
|
| 10 |
"""
|
| 11 |
Upload a single file to Hugging Face Hub
|
| 12 |
"""
|
| 13 |
-
|
| 14 |
if not token:
|
| 15 |
raise RuntimeError("Missing Hugging Face secret 'Key'. Add it in your Space → Settings → Secrets.")
|
| 16 |
|
|
@@ -42,7 +42,7 @@ def upload_folder_to_hub(folder_path, repo_id, folder_path_in_repo, repo_type,
|
|
| 42 |
"""
|
| 43 |
Upload a folder to Hugging Face Hub
|
| 44 |
"""
|
| 45 |
-
|
| 46 |
if not token:
|
| 47 |
raise RuntimeError("Missing Hugging Face secret 'Key'. Add it in your Space → Settings → Secrets.")
|
| 48 |
|
|
|
|
| 10 |
"""
|
| 11 |
Upload a single file to Hugging Face Hub
|
| 12 |
"""
|
| 13 |
+
token = os.getenv("Key") # read secret inside the function
|
| 14 |
if not token:
|
| 15 |
raise RuntimeError("Missing Hugging Face secret 'Key'. Add it in your Space → Settings → Secrets.")
|
| 16 |
|
|
|
|
| 42 |
"""
|
| 43 |
Upload a folder to Hugging Face Hub
|
| 44 |
"""
|
| 45 |
+
token = os.getenv("Key") # read secret inside the function
|
| 46 |
if not token:
|
| 47 |
raise RuntimeError("Missing Hugging Face secret 'Key'. Add it in your Space → Settings → Secrets.")
|
| 48 |
|