Spaces:
Sleeping
Sleeping
Delete assistant.py
Browse files- assistant.py +0 -31
assistant.py
DELETED
|
@@ -1,31 +0,0 @@
|
|
| 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, CurrencyConverterTool
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
# Initialize the Hugging Face model
|
| 10 |
-
model = HfApiModel()
|
| 11 |
-
|
| 12 |
-
# Initialize the web search tool
|
| 13 |
-
search_tool = DuckDuckGoSearchTool()
|
| 14 |
-
|
| 15 |
-
# Initialize the weather tool
|
| 16 |
-
currency_converter_tool = CurrencyConverterTool()
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
# Load the guest dataset and initialize the guest info tool
|
| 20 |
-
guest_info_tool = load_guest_dataset()
|
| 21 |
-
|
| 22 |
-
# Create Alfred with all the tools
|
| 23 |
-
alfred = CodeAgent(
|
| 24 |
-
tools=[currency_converter_tool, search_tool],
|
| 25 |
-
model=model,
|
| 26 |
-
add_base_tools=True, # Add any additional base tools
|
| 27 |
-
planning_interval=3 # Enable planning every 3 steps
|
| 28 |
-
)
|
| 29 |
-
|
| 30 |
-
if __name__ == "__main__":
|
| 31 |
-
GradioUI(alfred).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|