Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,17 @@
|
|
| 1 |
-
!pip install smolagents -U
|
| 2 |
|
| 3 |
-
from smolagents import CodeAgent,
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
agent
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
!pip install smolagents duckduckgo-search -U
|
| 2 |
|
| 3 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, InferenceClientModel
|
| 4 |
|
| 5 |
+
model = InferenceClientModel(
|
| 6 |
+
model_id="Qwen/Qwen2.5-Coder-7B-Instruct",
|
| 7 |
+
max_tokens=1024,
|
| 8 |
+
temperature=0.2
|
| 9 |
+
)
|
| 10 |
|
| 11 |
+
agent = CodeAgent(
|
| 12 |
+
model=model,
|
| 13 |
+
tools=[DuckDuckGoSearchTool()],
|
| 14 |
+
max_steps=5,
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
agent.run("Was sind die neuesten Nachrichten zur künstlichen Intelligenz?")
|