Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,6 +7,17 @@ from tempfile import NamedTemporaryFile
|
|
| 7 |
import pyttsx3
|
| 8 |
import logging
|
| 9 |
import time
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
# Set up logging
|
| 12 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 7 |
import pyttsx3
|
| 8 |
import logging
|
| 9 |
import time
|
| 10 |
+
from huggingface_hub import HfApi
|
| 11 |
+
|
| 12 |
+
# Get the HF_TOKEN from your Space's environment variables
|
| 13 |
+
#token = #os.environ.get("HF_TOKEN")
|
| 14 |
+
|
| 15 |
+
# Initialize the Hugging Face API client
|
| 16 |
+
api = HfApi()
|
| 17 |
+
|
| 18 |
+
# Example: Upload a file to the Hub
|
| 19 |
+
# Assuming you have a file named "my_file.txt"
|
| 20 |
+
# api.upload_file(repo_id="your_repo_id", path_in_repo="my_file.txt", file_path="my_file.txt", repo_type="dataset", token=token)
|
| 21 |
|
| 22 |
# Set up logging
|
| 23 |
logging.basicConfig(level=logging.INFO)
|