Spaces:
Sleeping
Sleeping
Create app.py
Browse filesInitial commit.
app.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from smolagents import (
|
| 2 |
+
TransformersModel,
|
| 3 |
+
# load_tool,
|
| 4 |
+
DuckDuckGoSearchTool,
|
| 5 |
+
# ApiWebSearchTool,
|
| 6 |
+
VisitWebpageTool,
|
| 7 |
+
# WebSearchTool,
|
| 8 |
+
WikipediaSearchTool,
|
| 9 |
+
PythonInterpreterTool,
|
| 10 |
+
UserInputTool,
|
| 11 |
+
FinalAnswerTool,
|
| 12 |
+
CodeAgent,
|
| 13 |
+
InferenceClientModel,
|
| 14 |
+
GradioUI
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
MODEL_NAME = "Qwen/Qwen3-0.6B"
|
| 18 |
+
|
| 19 |
+
model = TransformersModel(model_id=MODEL_NAME)
|
| 20 |
+
|
| 21 |
+
agent = CodeAgent(
|
| 22 |
+
tools=[ DuckDuckGoSearchTool(),
|
| 23 |
+
# ApiWebSearchTool(),
|
| 24 |
+
VisitWebpageTool(),
|
| 25 |
+
# WebSearchTool(),
|
| 26 |
+
WikipediaSearchTool(),
|
| 27 |
+
PythonInterpreterTool(),
|
| 28 |
+
UserInputTool(),
|
| 29 |
+
FinalAnswerTool()
|
| 30 |
+
|
| 31 |
+
],
|
| 32 |
+
model=model,
|
| 33 |
+
)
|
| 34 |
+
|
| 35 |
+
GradioUI(agent).launch()
|