Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,8 +3,11 @@ import gradio as gr
|
|
| 3 |
import requests
|
| 4 |
import os
|
| 5 |
|
|
|
|
|
|
|
|
|
|
| 6 |
TOKEN = os.getenv("HUGGINGFACE_API_TOKEN_V")
|
| 7 |
-
|
| 8 |
# Check if the API token is set
|
| 9 |
if not TOKEN:
|
| 10 |
raise ValueError("API token is not set. Please set the HUGGINGFACE_API_TOKEN environment variable.")
|
|
|
|
| 3 |
import requests
|
| 4 |
import os
|
| 5 |
|
| 6 |
+
import subprocess
|
| 7 |
+
subprocess.run(["huggingface-cli", "login", "--token", HUGGINGFACE_API_TOKEN_V])
|
| 8 |
+
|
| 9 |
TOKEN = os.getenv("HUGGINGFACE_API_TOKEN_V")
|
| 10 |
+
|
| 11 |
# Check if the API token is set
|
| 12 |
if not TOKEN:
|
| 13 |
raise ValueError("API token is not set. Please set the HUGGINGFACE_API_TOKEN environment variable.")
|