Thanh Vinh Vo
commited on
Commit
·
4d20ba5
1
Parent(s):
fd6fa9d
update
Browse files
app.py
CHANGED
|
@@ -10,6 +10,7 @@ from smolagents import (
|
|
| 10 |
DuckDuckGoSearchTool,
|
| 11 |
InferenceClientModel,
|
| 12 |
load_tool,
|
|
|
|
| 13 |
tool,
|
| 14 |
Tool,
|
| 15 |
ToolCollection,
|
|
@@ -27,14 +28,17 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 27 |
class BasicAgent:
|
| 28 |
def __init__(self):
|
| 29 |
print("BasicAgent initialized.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
self.agent = CodeAgent(
|
| 31 |
tools=[
|
| 32 |
VisitWebpageTool(),
|
| 33 |
DuckDuckGoSearchTool(),
|
| 34 |
],
|
| 35 |
-
model=
|
| 36 |
-
model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
|
| 37 |
-
),
|
| 38 |
additional_authorized_imports=[
|
| 39 |
"requests",
|
| 40 |
"bs4",
|
|
|
|
| 10 |
DuckDuckGoSearchTool,
|
| 11 |
InferenceClientModel,
|
| 12 |
load_tool,
|
| 13 |
+
OpenAIServerModel,
|
| 14 |
tool,
|
| 15 |
Tool,
|
| 16 |
ToolCollection,
|
|
|
|
| 28 |
class BasicAgent:
|
| 29 |
def __init__(self):
|
| 30 |
print("BasicAgent initialized.")
|
| 31 |
+
mOpenAI = OpenAIServerModel(model_id="gpt-4o")
|
| 32 |
+
mQwen = InferenceClientModel(
|
| 33 |
+
model_id="Qwen/Qwen2.5-Coder-32B-Instruct",
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
self.agent = CodeAgent(
|
| 37 |
tools=[
|
| 38 |
VisitWebpageTool(),
|
| 39 |
DuckDuckGoSearchTool(),
|
| 40 |
],
|
| 41 |
+
model=mOpenAI,
|
|
|
|
|
|
|
| 42 |
additional_authorized_imports=[
|
| 43 |
"requests",
|
| 44 |
"bs4",
|