Spaces:
Sleeping
Sleeping
PolPC13 commited on
Commit ·
4703af8
1
Parent(s): 8ac99e1
Renamed websearch tool and added import to app.py
Browse files- app.py +4 -4
- prompts.yaml +6 -0
app.py
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
-
from smolagents import CodeAgent,
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
from tools.exchange_rates import ExchangeRatesTool
|
| 8 |
-
from tools.web_search import
|
| 9 |
from tools.visit_webpage import VisitWebpageTool
|
| 10 |
from Gradio_UI import GradioUI
|
| 11 |
from tools.new_tools import ReverseStringTool, WikiSearchTool
|
| 12 |
from tools.get_current_time import GetCurrentTimeTool
|
| 13 |
-
|
| 14 |
final_answer = FinalAnswerTool()
|
| 15 |
|
| 16 |
# 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:
|
|
@@ -29,7 +29,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 29 |
|
| 30 |
agent = CodeAgent(
|
| 31 |
model=model,
|
| 32 |
-
tools=[final_answer,
|
| 33 |
max_steps=6,
|
| 34 |
verbosity_level=1,
|
| 35 |
grammar=None,
|
|
|
|
| 1 |
+
from smolagents import CodeAgent, HfApiModel
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
from tools.exchange_rates import ExchangeRatesTool
|
| 8 |
+
from tools.web_search import web_search
|
| 9 |
from tools.visit_webpage import VisitWebpageTool
|
| 10 |
from Gradio_UI import GradioUI
|
| 11 |
from tools.new_tools import ReverseStringTool, WikiSearchTool
|
| 12 |
from tools.get_current_time import GetCurrentTimeTool
|
| 13 |
+
import yaml
|
| 14 |
final_answer = FinalAnswerTool()
|
| 15 |
|
| 16 |
# 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:
|
|
|
|
| 29 |
|
| 30 |
agent = CodeAgent(
|
| 31 |
model=model,
|
| 32 |
+
tools=[final_answer, web_search(), VisitWebpageTool(), ExchangeRatesTool(), WikiSearchTool(), ReverseStringTool(), GetCurrentTimeTool()], ## add your tools here (don't remove final answer)
|
| 33 |
max_steps=6,
|
| 34 |
verbosity_level=1,
|
| 35 |
grammar=None,
|
prompts.yaml
CHANGED
|
@@ -323,3 +323,9 @@
|
|
| 323 |
"report": |-
|
| 324 |
Here is the final answer from your managed agent '{{name}}':
|
| 325 |
{{final_answer}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 323 |
"report": |-
|
| 324 |
Here is the final answer from your managed agent '{{name}}':
|
| 325 |
{{final_answer}}
|
| 326 |
+
"final_answer":
|
| 327 |
+
"pre_messages": |-
|
| 328 |
+
You have reached the maximum number of steps.
|
| 329 |
+
Based on the work done so far, please provide the best possible final answer to the original task.
|
| 330 |
+
If you have a clear answer, provide it. If not, explain what you have found and why you cannot provide a definitive answer.
|
| 331 |
+
Task: {{task}}
|