Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
-
|
| 2 |
-
from smolagents import CodeAgent, DuckDuckGoSearchTool, FinalAnswerTool, InferenceClientModel, load_tool, tool
|
| 3 |
import datetime
|
| 4 |
import requests
|
| 5 |
import pytz
|
| 6 |
import yaml
|
| 7 |
-
|
| 8 |
import asyncio
|
| 9 |
from typing import Any
|
| 10 |
import python_weather
|
|
@@ -66,7 +66,7 @@ final_answer = FinalAnswerTool()
|
|
| 66 |
# 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:
|
| 67 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 68 |
|
| 69 |
-
model =
|
| 70 |
max_tokens=2096,
|
| 71 |
temperature=0.5,
|
| 72 |
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
|
@@ -85,7 +85,7 @@ agent = CodeAgent(
|
|
| 85 |
tools=[final_answer], ## add your tools here (don't remove final answer)
|
| 86 |
max_steps=6,
|
| 87 |
verbosity_level=1,
|
| 88 |
-
|
| 89 |
planning_interval=None,
|
| 90 |
name=None,
|
| 91 |
description=None,
|
|
|
|
| 1 |
+
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
|
| 2 |
+
# from smolagents import CodeAgent, DuckDuckGoSearchTool, FinalAnswerTool, InferenceClientModel, load_tool, tool
|
| 3 |
import datetime
|
| 4 |
import requests
|
| 5 |
import pytz
|
| 6 |
import yaml
|
| 7 |
+
from tools.final_answer import FinalAnswerTool
|
| 8 |
import asyncio
|
| 9 |
from typing import Any
|
| 10 |
import python_weather
|
|
|
|
| 66 |
# 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:
|
| 67 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 68 |
|
| 69 |
+
model = HfApiModel(
|
| 70 |
max_tokens=2096,
|
| 71 |
temperature=0.5,
|
| 72 |
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
|
|
|
| 85 |
tools=[final_answer], ## add your tools here (don't remove final answer)
|
| 86 |
max_steps=6,
|
| 87 |
verbosity_level=1,
|
| 88 |
+
grammar=None
|
| 89 |
planning_interval=None,
|
| 90 |
name=None,
|
| 91 |
description=None,
|