artintel235 commited on
Commit
2f46363
·
verified ·
1 Parent(s): d02b0d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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 GLIF API."
58
 
59
  except asyncio.TimeoutError:
60
- return "Error: GLIF API request timed out."
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. {image_url_or_error}"
98
  )
99
  except Exception as e:
100
- await interaction.followup.send(f"Error: {str(e)}")
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!")