Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,17 @@
|
|
| 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 |
-
|
|
|
|
|
|
|
| 11 |
|
| 12 |
# Initialize the web search tool
|
| 13 |
search_tool = DuckDuckGoSearchTool()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import random
|
| 3 |
from smolagents import GradioUI, CodeAgent, HfApiModel
|
| 4 |
+
# added
|
| 5 |
+
import os
|
| 6 |
|
| 7 |
# Import our custom tools from their modules
|
| 8 |
from tools import DuckDuckGoSearchTool, WeatherInfoTool, HubStatsTool
|
| 9 |
from retriever import load_guest_dataset
|
| 10 |
|
| 11 |
# Initialize the Hugging Face model
|
| 12 |
+
# added token
|
| 13 |
+
HF_TOKEN = os.environ['HF_TOKEN']
|
| 14 |
+
model = HfApiModel(token=HF_TOKEN)
|
| 15 |
|
| 16 |
# Initialize the web search tool
|
| 17 |
search_tool = DuckDuckGoSearchTool()
|