Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,9 +53,10 @@ image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_co
|
|
| 53 |
with open("prompts.yaml", 'r') as stream:
|
| 54 |
prompt_templates = yaml.safe_load(stream)
|
| 55 |
|
|
|
|
| 56 |
agent = CodeAgent(
|
| 57 |
model=model,
|
| 58 |
-
tools=[final_answer,image_generation_tool],
|
| 59 |
max_steps=6,
|
| 60 |
verbosity_level=1,
|
| 61 |
grammar=None,
|
|
@@ -65,5 +66,7 @@ agent = CodeAgent(
|
|
| 65 |
prompt_templates=prompt_templates
|
| 66 |
)
|
| 67 |
|
| 68 |
-
|
| 69 |
-
|
|
|
|
|
|
|
|
|
| 53 |
with open("prompts.yaml", 'r') as stream:
|
| 54 |
prompt_templates = yaml.safe_load(stream)
|
| 55 |
|
| 56 |
+
# Add the image generation tool to your tools list (around line 34)
|
| 57 |
agent = CodeAgent(
|
| 58 |
model=model,
|
| 59 |
+
tools=[final_answer, image_generation_tool], # Added image_generation_tool here
|
| 60 |
max_steps=6,
|
| 61 |
verbosity_level=1,
|
| 62 |
grammar=None,
|
|
|
|
| 66 |
prompt_templates=prompt_templates
|
| 67 |
)
|
| 68 |
|
| 69 |
+
# Add this right before launching the Gradio UI
|
| 70 |
+
image = image_generation_tool(prompt="A high-res photorealistic image of an Arabian horse running in the desert")
|
| 71 |
+
final_answer(image)
|
| 72 |
+
GradioUI(agent).launch()
|