Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,14 +1,13 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import random
|
| 3 |
-
from smolagents import GradioUI,
|
| 4 |
|
| 5 |
# Import our custom tools from their modules
|
| 6 |
from tools import DuckDuckGoSearchTool, WeatherInfoTool, HubStatsTool
|
| 7 |
from retriever import load_guest_dataset
|
| 8 |
|
| 9 |
# Initialize the Hugging Face model
|
| 10 |
-
|
| 11 |
-
model = HfApiModel("Qwen/Qwen2.5-72B-Instruct")
|
| 12 |
|
| 13 |
# Initialize the web search tool
|
| 14 |
search_tool = DuckDuckGoSearchTool()
|
|
@@ -22,14 +21,8 @@ hub_stats_tool = HubStatsTool()
|
|
| 22 |
# Load the guest dataset and initialize the guest info tool
|
| 23 |
guest_info_tool = load_guest_dataset()
|
| 24 |
|
| 25 |
-
# testing tools to see if they even work
|
| 26 |
-
|
| 27 |
-
print(guest_info_tool.forward("Alice"))
|
| 28 |
-
print(search_tool.forward("current US president"))
|
| 29 |
-
print(weather_info_tool.forward("Paris"))
|
| 30 |
-
|
| 31 |
# Create Alfred with all the tools
|
| 32 |
-
alfred =
|
| 33 |
tools=[guest_info_tool, weather_info_tool, hub_stats_tool, search_tool],
|
| 34 |
model=model,
|
| 35 |
add_base_tools=True, # Add any additional base tools
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import random
|
| 3 |
+
from smolagents import GradioUI, CodeAgent, HfApiModel
|
| 4 |
|
| 5 |
# Import our custom tools from their modules
|
| 6 |
from tools import DuckDuckGoSearchTool, WeatherInfoTool, HubStatsTool
|
| 7 |
from retriever import load_guest_dataset
|
| 8 |
|
| 9 |
# Initialize the Hugging Face model
|
| 10 |
+
model = HfApiModel()
|
|
|
|
| 11 |
|
| 12 |
# Initialize the web search tool
|
| 13 |
search_tool = DuckDuckGoSearchTool()
|
|
|
|
| 21 |
# Load the guest dataset and initialize the guest info tool
|
| 22 |
guest_info_tool = load_guest_dataset()
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
# Create Alfred with all the tools
|
| 25 |
+
alfred = CodeAgent(
|
| 26 |
tools=[guest_info_tool, weather_info_tool, hub_stats_tool, search_tool],
|
| 27 |
model=model,
|
| 28 |
add_base_tools=True, # Add any additional base tools
|