Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -54,10 +54,10 @@ async def generate_image_async(prompt, aspect_ratio):
|
|
54 |
elif "output" in response_data:
|
55 |
return f"prompt:{response_data['inputs']['Prompt']}\noutput:{response_data['output']}"
|
56 |
else:
|
57 |
-
return "Error: Unexpected response from
|
58 |
|
59 |
except asyncio.TimeoutError:
|
60 |
-
return "Error:
|
61 |
except aiohttp.ClientError as e:
|
62 |
return f"API request failed: {e}"
|
63 |
except Exception as e:
|
@@ -94,10 +94,10 @@ async def generate_command(
|
|
94 |
)
|
95 |
else:
|
96 |
await interaction.followup.send(
|
97 |
-
f"Sorry, I couldn't generate an image
|
98 |
)
|
99 |
except Exception as e:
|
100 |
-
await interaction.followup.send(f"Error
|
101 |
|
102 |
|
103 |
@tree.command(name="hello", description="Says hello!")
|
|
|
54 |
elif "output" in response_data:
|
55 |
return f"prompt:{response_data['inputs']['Prompt']}\noutput:{response_data['output']}"
|
56 |
else:
|
57 |
+
return "Error: Unexpected response from server"
|
58 |
|
59 |
except asyncio.TimeoutError:
|
60 |
+
return "Error: API request timed out."
|
61 |
except aiohttp.ClientError as e:
|
62 |
return f"API request failed: {e}"
|
63 |
except Exception as e:
|
|
|
94 |
)
|
95 |
else:
|
96 |
await interaction.followup.send(
|
97 |
+
f"Sorry, I couldn't generate an image"
|
98 |
)
|
99 |
except Exception as e:
|
100 |
+
await interaction.followup.send(f"Error")
|
101 |
|
102 |
|
103 |
@tree.command(name="hello", description="Says hello!")
|