Ishikawa7 commited on
Commit
3634e00
·
verified ·
1 Parent(s): 7f8a438

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
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
- #api_key = os.getenv("FEATHERLESS_API_KEY")
75
- #print("FEATHERLESS_API_KEY:", api_key)
76
- model = InferenceClientModel()
 
 
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],