Spaces:
Sleeping
Sleeping
Update app.py
Browse filesTrying to get generate_image working
app.py
CHANGED
@@ -52,14 +52,14 @@ 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.
|
59 |
"""
|
60 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
61 |
image = image_generation_tool(description)
|
62 |
-
return
|
63 |
|
64 |
|
65 |
|
|
|
52 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
53 |
|
54 |
@tool
|
55 |
+
def generate_image(description: str) -> 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.
|
59 |
"""
|
60 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
61 |
image = image_generation_tool(description)
|
62 |
+
return f"Image generated for prompt: {description}."
|
63 |
|
64 |
|
65 |
|