Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import os
|
|
| 2 |
import gradio as gr
|
| 3 |
import requests
|
| 4 |
import pandas as pd
|
| 5 |
-
from smolagents import CodeAgent, DuckDuckGoSearchTool,
|
| 6 |
# Test comment
|
| 7 |
|
| 8 |
# (Keep Constants as is)
|
|
@@ -16,7 +16,7 @@ class BasicAgent:
|
|
| 16 |
print("BasicAgent initialized.")
|
| 17 |
token_key = os.getenv("HFAPI_KEY")
|
| 18 |
# Initialize the search tool
|
| 19 |
-
model =
|
| 20 |
search_tool = DuckDuckGoSearchTool()
|
| 21 |
|
| 22 |
self.agent = CodeAgent(model=model, tools=[search_tool])
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import requests
|
| 4 |
import pandas as pd
|
| 5 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
|
| 6 |
# Test comment
|
| 7 |
|
| 8 |
# (Keep Constants as is)
|
|
|
|
| 16 |
print("BasicAgent initialized.")
|
| 17 |
token_key = os.getenv("HFAPI_KEY")
|
| 18 |
# Initialize the search tool
|
| 19 |
+
model = HfApiModel(model_id="Qwen/Qwen2.5-7B-Instruct", api_key=token_key)
|
| 20 |
search_tool = DuckDuckGoSearchTool()
|
| 21 |
|
| 22 |
self.agent = CodeAgent(model=model, tools=[search_tool])
|