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 load_tool, CodeAgent, InferenceClientModel, DuckDuckGoSearchTool
|
8 |
from dotenv import load_dotenv
|
9 |
|
10 |
# (Сохраните константы как есть)
|
@@ -33,10 +33,13 @@ class BasicAgent:
|
|
33 |
def __init__(self):
|
34 |
print("BasicAgent initialized.")
|
35 |
|
36 |
-
self.agent = CodeAgent(tools=[search_tool],
|
37 |
-
|
38 |
-
|
39 |
-
)
|
|
|
|
|
|
|
40 |
|
41 |
print("Agent initialized successfully.")
|
42 |
|
|
|
4 |
import inspect
|
5 |
import pandas as pd
|
6 |
|
7 |
+
from smolagents import load_tool, CodeAgent, InferenceClientModel, DuckDuckGoSearchTool, TransformersModel
|
8 |
from dotenv import load_dotenv
|
9 |
|
10 |
# (Сохраните константы как есть)
|
|
|
33 |
def __init__(self):
|
34 |
print("BasicAgent initialized.")
|
35 |
|
36 |
+
# self.agent = CodeAgent(tools=[search_tool],
|
37 |
+
# model=InferenceClientModel(model_id="Qwen/Qwen2.5-72B-Instruct"),
|
38 |
+
# planning_interval=3
|
39 |
+
# )
|
40 |
+
|
41 |
+
self.model = TransformersModel(model_id="HuggingFaceTB/SmolLM2-1.7B-Instruct", device_map="auto", max_new_tokens=1000)
|
42 |
+
self.agent = ToolCallingAgent(tools=[search_tool], model=model, verbosity_level=2)
|
43 |
|
44 |
print("Agent initialized successfully.")
|
45 |
|