Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -73,7 +73,12 @@ def convert_currency(amount: float, from_currency: str, to_currency: str) -> flo
|
|
| 73 |
converted = amount * rates[to_currency.lower()]
|
| 74 |
|
| 75 |
return round(converted, 2)
|
| 76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
final_answer = FinalAnswerTool()
|
| 78 |
|
| 79 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
|
@@ -86,16 +91,12 @@ model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may
|
|
| 86 |
custom_role_conversions=None,
|
| 87 |
)
|
| 88 |
|
| 89 |
-
|
| 90 |
-
# Import tool from Hub
|
| 91 |
-
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 92 |
-
|
| 93 |
with open("prompts.yaml", 'r') as stream:
|
| 94 |
prompt_templates = yaml.safe_load(stream)
|
| 95 |
|
| 96 |
agent = CodeAgent(
|
| 97 |
model=model,
|
| 98 |
-
tools=[final_answer, image_generation_tool, get_current_time_in_timezone, wiki_of_person, convert_currency], ## add your tools here (don't remove final answer)
|
| 99 |
max_steps=6,
|
| 100 |
verbosity_level=1,
|
| 101 |
grammar=None,
|
|
|
|
| 73 |
converted = amount * rates[to_currency.lower()]
|
| 74 |
|
| 75 |
return round(converted, 2)
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
# Import tool from Hub
|
| 79 |
+
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 80 |
+
search_tool = DuckDuckGoSearchTool()
|
| 81 |
+
|
| 82 |
final_answer = FinalAnswerTool()
|
| 83 |
|
| 84 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
|
|
|
| 91 |
custom_role_conversions=None,
|
| 92 |
)
|
| 93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
with open("prompts.yaml", 'r') as stream:
|
| 95 |
prompt_templates = yaml.safe_load(stream)
|
| 96 |
|
| 97 |
agent = CodeAgent(
|
| 98 |
model=model,
|
| 99 |
+
tools=[final_answer, image_generation_tool, get_current_time_in_timezone, wiki_of_person, convert_currency, search_tool], ## add your tools here (don't remove final answer)
|
| 100 |
max_steps=6,
|
| 101 |
verbosity_level=1,
|
| 102 |
grammar=None,
|