Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import inspect
|
| 3 |
-
from smolagents import CodeAgent, load_tool, InferenceClientModel
|
| 4 |
from smolagents.tools import tool
|
| 5 |
import math, ast, os, requests, pandas as pd
|
| 6 |
# (Keep Constants as is)
|
|
@@ -71,9 +71,11 @@ def download(task_id: str) -> str:
|
|
| 71 |
return f"Error: {e}"
|
| 72 |
|
| 73 |
# --- Initialize the agent ---
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
|
|
|
|
|
|
| 77 |
|
| 78 |
agent = CodeAgent(
|
| 79 |
tools=[calc, run_py, download],
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import inspect
|
| 3 |
+
from smolagents import CodeAgent, load_tool, InferenceClientModel, LiteLLMModel
|
| 4 |
from smolagents.tools import tool
|
| 5 |
import math, ast, os, requests, pandas as pd
|
| 6 |
# (Keep Constants as is)
|
|
|
|
| 71 |
return f"Error: {e}"
|
| 72 |
|
| 73 |
# --- Initialize the agent ---
|
| 74 |
+
model = LiteLLMModel(
|
| 75 |
+
model_id="ollama_chat/qwen2:7b", # Or try other Ollama-supported models
|
| 76 |
+
api_base="http://127.0.0.1:11434", # Default Ollama local server
|
| 77 |
+
num_ctx=8192,
|
| 78 |
+
)
|
| 79 |
|
| 80 |
agent = CodeAgent(
|
| 81 |
tools=[calc, run_py, download],
|