dannyskull commited on
Commit
265be21
·
verified ·
1 Parent(s): 7613252

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1,10 +1,10 @@
1
- # from smolagents import CodeAgent,DuckDuckGoSearchTool, InferenceClientModel,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,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 = InferenceClientModel(
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
- # grammar=None, obsolete
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,