Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -21,19 +21,8 @@ def show_image(image : Image.Image )-> str :#it's import to specify the return t
|
|
21 |
"""A tool that shows image generated by image_generation_tool
|
22 |
Args:
|
23 |
image: the input image with the original type
|
24 |
-
"""
|
25 |
-
|
26 |
-
if isinstance(image, Image.Image):
|
27 |
-
pil_image = image
|
28 |
-
image.show()
|
29 |
-
elif hasattr(image, 'to_pil'):
|
30 |
-
pil_image = agent_image.to_pil()
|
31 |
-
elif hasattr(image, 'image') and isinstance(agent_image.image, Image.Image):
|
32 |
-
pil_image = agent_image.image
|
33 |
-
else:
|
34 |
-
# If none of the above, you'll need to investigate further
|
35 |
-
print("Could not directly convert. Check the object's attributes and methods.")
|
36 |
-
# For example, print(dir(agent_image)) to see what's available
|
37 |
return "image showed successfully!"
|
38 |
|
39 |
@tool
|
|
|
21 |
"""A tool that shows image generated by image_generation_tool
|
22 |
Args:
|
23 |
image: the input image with the original type
|
24 |
+
"""
|
25 |
+
image.show()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
return "image showed successfully!"
|
27 |
|
28 |
@tool
|