Spaces:
Sleeping
Sleeping
vijay
commited on
Commit
·
bf0f320
1
Parent(s):
8b95940
update model to openAIserver
Browse files- app.py +3 -3
- requirements.txt +2 -1
app.py
CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
|
|
3 |
import requests
|
4 |
import inspect
|
5 |
import pandas as pd
|
6 |
-
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
|
7 |
|
8 |
# (Keep Constants as is)
|
9 |
# --- Constants ---
|
@@ -14,8 +14,8 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
14 |
class BasicAgent:
|
15 |
def __init__(self):
|
16 |
print("BasicAgent initialized.")
|
17 |
-
self.agent = CodeAgent(tools=[DuckDuckGoSearchTool()
|
18 |
-
model_id =
|
19 |
|
20 |
def __call__(self, question: str) -> str:
|
21 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
|
|
3 |
import requests
|
4 |
import inspect
|
5 |
import pandas as pd
|
6 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, OpenAIServerModel, PythonInterpreterTool
|
7 |
|
8 |
# (Keep Constants as is)
|
9 |
# --- Constants ---
|
|
|
14 |
class BasicAgent:
|
15 |
def __init__(self):
|
16 |
print("BasicAgent initialized.")
|
17 |
+
self.agent = CodeAgent(tools=[DuckDuckGoSearchTool(), PythonInterpreterTool()],
|
18 |
+
model=OpenAIServerModel(model_id = "gpt-4o"))
|
19 |
|
20 |
def __call__(self, question: str) -> str:
|
21 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
requirements.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
gradio
|
2 |
requests
|
3 |
-
smolagents
|
|
|
|
1 |
gradio
|
2 |
requests
|
3 |
+
smolagents[openai]
|
4 |
+
smolagents==1.13.0
|