Spaces:
Runtime error
Runtime error
Update app.py
Browse filesFixed misnaming of generate image
app.py
CHANGED
|
@@ -58,7 +58,8 @@ def generate_image(description: str) -> Image:
|
|
| 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 |
-
|
|
|
|
| 62 |
|
| 63 |
|
| 64 |
|
|
@@ -76,14 +77,14 @@ custom_role_conversions=None,
|
|
| 76 |
|
| 77 |
|
| 78 |
# Import tool from Hub
|
| 79 |
-
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 80 |
|
| 81 |
with open("prompts.yaml", 'r') as stream:
|
| 82 |
prompt_templates = yaml.safe_load(stream)
|
| 83 |
|
| 84 |
agent = CodeAgent(
|
| 85 |
model=model,
|
| 86 |
-
tools=[final_answer, get_web_search_results,
|
| 87 |
max_steps=6,
|
| 88 |
verbosity_level=1,
|
| 89 |
grammar=None,
|
|
|
|
| 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 image
|
| 63 |
|
| 64 |
|
| 65 |
|
|
|
|
| 77 |
|
| 78 |
|
| 79 |
# Import tool from Hub
|
| 80 |
+
# image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 81 |
|
| 82 |
with open("prompts.yaml", 'r') as stream:
|
| 83 |
prompt_templates = yaml.safe_load(stream)
|
| 84 |
|
| 85 |
agent = CodeAgent(
|
| 86 |
model=model,
|
| 87 |
+
tools=[final_answer, get_web_search_results, generate_image], ## add your tools here (don't remove final answer)
|
| 88 |
max_steps=6,
|
| 89 |
verbosity_level=1,
|
| 90 |
grammar=None,
|