Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,13 +2,8 @@ import gradio as gr
|
|
| 2 |
from huggingface_hub import HfApi
|
| 3 |
import os
|
| 4 |
|
| 5 |
-
# Initialize HfApi
|
| 6 |
-
token = os.getenv("HF_TOKEN") # or whatever your secret name is
|
| 7 |
|
| 8 |
-
|
| 9 |
-
raise RuntimeError("Missing Hugging Face secret. Check your Space → Settings → Secrets.")
|
| 10 |
-
|
| 11 |
-
api = HfApi(token=token)
|
| 12 |
|
| 13 |
|
| 14 |
def upload_file_to_hub(file_path, repo_id, path_in_repo, token, repo_type, commit_message):
|
|
|
|
| 2 |
from huggingface_hub import HfApi
|
| 3 |
import os
|
| 4 |
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
api = HfApi()
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
def upload_file_to_hub(file_path, repo_id, path_in_repo, token, repo_type, commit_message):
|