Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,14 +23,15 @@ def generate_image(prompt):
|
|
| 23 |
)
|
| 24 |
|
| 25 |
if response.status_code != 200:
|
| 26 |
-
print("ERROR:", response.text)
|
| 27 |
-
return "
|
| 28 |
|
| 29 |
data = response.json()
|
| 30 |
image_base64 = data["artifacts"][0]["base64"]
|
| 31 |
image_bytes = base64.b64decode(image_base64)
|
| 32 |
return image_bytes
|
| 33 |
|
|
|
|
| 34 |
iface = gr.Interface(
|
| 35 |
fn=generate_image,
|
| 36 |
inputs=gr.Textbox(label="Prompt", placeholder="Describe your image..."),
|
|
|
|
| 23 |
)
|
| 24 |
|
| 25 |
if response.status_code != 200:
|
| 26 |
+
print("ERROR:", response.text) # ← prints the full error in your Hugging Face logs
|
| 27 |
+
return f"❌ ERROR: {response.text}" # ← also shows it on the screen
|
| 28 |
|
| 29 |
data = response.json()
|
| 30 |
image_base64 = data["artifacts"][0]["base64"]
|
| 31 |
image_bytes = base64.b64decode(image_base64)
|
| 32 |
return image_bytes
|
| 33 |
|
| 34 |
+
|
| 35 |
iface = gr.Interface(
|
| 36 |
fn=generate_image,
|
| 37 |
inputs=gr.Textbox(label="Prompt", placeholder="Describe your image..."),
|