Update app.py
Browse files
app.py
CHANGED
@@ -85,8 +85,13 @@ def generate_image(prompt):
|
|
85 |
st.error("Unexpected result format from the Gradio API.")
|
86 |
return None
|
87 |
except Exception as e:
|
88 |
-
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
90 |
return None
|
91 |
|
92 |
def main():
|
|
|
85 |
st.error("Unexpected result format from the Gradio API.")
|
86 |
return None
|
87 |
except Exception as e:
|
88 |
+
error_message = str(e)
|
89 |
+
match = re.search(r'retry in (\d+:\d+:\d+)', error_message)
|
90 |
+
if match:
|
91 |
+
wait_time = match.group(1)
|
92 |
+
st.error(f"Please wait {wait_time} before you try again. Meanwhile, leave a like if you like the app!")
|
93 |
+
else:
|
94 |
+
st.error(f"Error generating image: {e}")
|
95 |
return None
|
96 |
|
97 |
def main():
|