Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,25 +71,20 @@ model = HfApiModel(
|
|
| 71 |
# Import tool from Hugging Face Hub
|
| 72 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 73 |
|
| 74 |
-
|
| 75 |
-
with open("prompts.yaml", "r") as stream:
|
| 76 |
prompt_templates = yaml.safe_load(stream)
|
| 77 |
-
|
| 78 |
-
# Agent Setup
|
| 79 |
-
|
| 80 |
agent = CodeAgent(
|
| 81 |
model=model,
|
| 82 |
-
tools=[final_answer],
|
| 83 |
max_steps=6,
|
| 84 |
verbosity_level=1,
|
| 85 |
grammar=None,
|
| 86 |
planning_interval=None,
|
| 87 |
name=None,
|
| 88 |
description=None,
|
| 89 |
-
prompt_templates=prompt_templates
|
| 90 |
)
|
| 91 |
|
| 92 |
-
# Launch the Gradio UI
|
| 93 |
|
| 94 |
-
|
| 95 |
-
GradioUI(agent).launch(debug=True, share=True)
|
|
|
|
| 71 |
# Import tool from Hugging Face Hub
|
| 72 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 73 |
|
| 74 |
+
with open("prompts.yaml", 'r') as stream:
|
|
|
|
| 75 |
prompt_templates = yaml.safe_load(stream)
|
| 76 |
+
|
|
|
|
|
|
|
| 77 |
agent = CodeAgent(
|
| 78 |
model=model,
|
| 79 |
+
tools=[final_answer], # add your tools here (don't remove final_answer)
|
| 80 |
max_steps=6,
|
| 81 |
verbosity_level=1,
|
| 82 |
grammar=None,
|
| 83 |
planning_interval=None,
|
| 84 |
name=None,
|
| 85 |
description=None,
|
| 86 |
+
prompt_templates=prompt_templates
|
| 87 |
)
|
| 88 |
|
|
|
|
| 89 |
|
| 90 |
+
GradioUI(agent).launch()
|
|
|