Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import requests
|
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
|
| 7 |
-
from smolagents import CodeAgent,DuckDuckGoSearchTool,
|
| 8 |
from tools.final_answer import FinalAnswerTool
|
| 9 |
import yaml
|
| 10 |
|
|
@@ -21,19 +21,14 @@ class BasicAgent:
|
|
| 21 |
# 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:
|
| 22 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 23 |
|
| 24 |
-
model =
|
| 25 |
-
max_tokens=2096,
|
| 26 |
-
temperature=0.5,
|
| 27 |
-
model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud', #Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 28 |
-
custom_role_conversions=None,
|
| 29 |
-
)
|
| 30 |
|
| 31 |
with open("prompts.yaml", 'r') as stream:
|
| 32 |
prompt_templates = yaml.safe_load(stream)
|
| 33 |
|
| 34 |
self.agent = CodeAgent(
|
| 35 |
model=model,
|
| 36 |
-
tools=[final_answer], ## add your tools here (don't remove final answer)
|
| 37 |
max_steps=6,
|
| 38 |
verbosity_level=1,
|
| 39 |
grammar=None,
|
|
|
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
|
| 7 |
+
from smolagents import CodeAgent,DuckDuckGoSearchTool, InferenceClientModel
|
| 8 |
from tools.final_answer import FinalAnswerTool
|
| 9 |
import yaml
|
| 10 |
|
|
|
|
| 21 |
# 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:
|
| 22 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 23 |
|
| 24 |
+
model = InferenceClientModel()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
with open("prompts.yaml", 'r') as stream:
|
| 27 |
prompt_templates = yaml.safe_load(stream)
|
| 28 |
|
| 29 |
self.agent = CodeAgent(
|
| 30 |
model=model,
|
| 31 |
+
tools=[final_answer, DuckDuckGoSearchTool()], ## add your tools here (don't remove final answer)
|
| 32 |
max_steps=6,
|
| 33 |
verbosity_level=1,
|
| 34 |
grammar=None,
|