Spaces:
Runtime error
Runtime error
Update app.py
Browse filesTry specifying Image type
app.py
CHANGED
|
@@ -52,7 +52,7 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 52 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 53 |
|
| 54 |
@tool
|
| 55 |
-
def generate_image(description: str) ->
|
| 56 |
"""A tool that generates an image from a text description.
|
| 57 |
Args:
|
| 58 |
description: A string representing the text description to generate an image of.
|
|
@@ -63,8 +63,9 @@ def generate_image(description: str) -> str:
|
|
| 63 |
description="Generate an image from a prompt"
|
| 64 |
)
|
| 65 |
# image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 66 |
-
image = image_generation_tool(description)
|
| 67 |
# return f"Image generated for prompt: {description}."
|
|
|
|
| 68 |
|
| 69 |
|
| 70 |
|
|
|
|
| 52 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 53 |
|
| 54 |
@tool
|
| 55 |
+
def generate_image(description: str) -> Image:
|
| 56 |
"""A tool that generates an image from a text description.
|
| 57 |
Args:
|
| 58 |
description: A string representing the text description to generate an image of.
|
|
|
|
| 63 |
description="Generate an image from a prompt"
|
| 64 |
)
|
| 65 |
# image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 66 |
+
image: Image = image_generation_tool(description)
|
| 67 |
# return f"Image generated for prompt: {description}."
|
| 68 |
+
return image
|
| 69 |
|
| 70 |
|
| 71 |
|