Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import os
|
|
| 2 |
import requests
|
| 3 |
import gradio as gr
|
| 4 |
import spaces
|
| 5 |
-
from smolagents import CodeAgent, DuckDuckGoSearchTool,
|
| 6 |
|
| 7 |
# 1. Custom tool to download files if needed for tasks
|
| 8 |
@tool
|
|
@@ -22,8 +22,8 @@ def get_file_content_tool(task_id: str) -> str:
|
|
| 22 |
return f"File downloaded successfully as {filename}."
|
| 23 |
return f"Failed to download file for task {task_id}"
|
| 24 |
|
| 25 |
-
# 2. Initialize the model using
|
| 26 |
-
model =
|
| 27 |
|
| 28 |
agent = CodeAgent(
|
| 29 |
tools=[DuckDuckGoSearchTool(), get_file_content_tool],
|
|
|
|
| 2 |
import requests
|
| 3 |
import gradio as gr
|
| 4 |
import spaces
|
| 5 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, InferenceClientModel, tool
|
| 6 |
|
| 7 |
# 1. Custom tool to download files if needed for tasks
|
| 8 |
@tool
|
|
|
|
| 22 |
return f"File downloaded successfully as {filename}."
|
| 23 |
return f"Failed to download file for task {task_id}"
|
| 24 |
|
| 25 |
+
# 2. Initialize the model using InferenceClientModel
|
| 26 |
+
model = InferenceClientModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct")
|
| 27 |
|
| 28 |
agent = CodeAgent(
|
| 29 |
tools=[DuckDuckGoSearchTool(), get_file_content_tool],
|