Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,8 @@ import yaml
|
|
6 |
from tools.final_answer import FinalAnswerTool
|
7 |
from tools.visit_webpage import VisitWebpageTool
|
8 |
import os
|
|
|
|
|
9 |
|
10 |
from Gradio_UI import GradioUI
|
11 |
|
@@ -27,7 +29,10 @@ def generate_and_show_surfer_image(next_tide: str) -> str:
|
|
27 |
prompt = f"Generate a surfer {action}"
|
28 |
try:
|
29 |
image_result = image_generation_tool(prompt)
|
30 |
-
|
|
|
|
|
|
|
31 |
except Exception as e:
|
32 |
return f"Error generating image: {str(e)}"
|
33 |
|
|
|
6 |
from tools.final_answer import FinalAnswerTool
|
7 |
from tools.visit_webpage import VisitWebpageTool
|
8 |
import os
|
9 |
+
import IPython.display as display
|
10 |
+
|
11 |
|
12 |
from Gradio_UI import GradioUI
|
13 |
|
|
|
29 |
prompt = f"Generate a surfer {action}"
|
30 |
try:
|
31 |
image_result = image_generation_tool(prompt)
|
32 |
+
if isinstance(image_result, str) and image_result.startswith("http"):
|
33 |
+
display.display(display.Image(url=image_result))
|
34 |
+
else:
|
35 |
+
display.display(display.Image(image_result))
|
36 |
except Exception as e:
|
37 |
return f"Error generating image: {str(e)}"
|
38 |
|