Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -27,9 +27,9 @@ constraints = (
|
|
27 |
def generate_image(prompt):
|
28 |
print("Generating image with prompt:", prompt)
|
29 |
api_url = f"https://api-inference.huggingface.co/models/{repo}"
|
30 |
-
token = os.getenv("
|
31 |
if not token:
|
32 |
-
raise ValueError("
|
33 |
headers = {
|
34 |
"Authorization": f"Bearer {token}"
|
35 |
}
|
|
|
27 |
def generate_image(prompt):
|
28 |
print("Generating image with prompt:", prompt)
|
29 |
api_url = f"https://api-inference.huggingface.co/models/{repo}"
|
30 |
+
token = os.getenv("HF_TOKEN") # Fetch from environment
|
31 |
if not token:
|
32 |
+
raise ValueError("HF_TOKEN environment variable is not set.")
|
33 |
headers = {
|
34 |
"Authorization": f"Bearer {token}"
|
35 |
}
|