Files changed (1) hide show
  1. app.py +5 -1
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
- model = HfApiModel()
11
 
12
  # Initialize the web search tool
13
  search_tool = DuckDuckGoSearchTool()
 
1
  import gradio as gr
2
  import random
3
+ import os
4
+ import getpass
5
  from smolagents import GradioUI, CodeAgent, HfApiModel
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
+ os.environ["HF_TOKEN"] = getpass.getpass("Enter HF token:")
12
+
13
  # Initialize the Hugging Face model
14
+ model = HfApiModel(api_token=os.environ["HF_TOKEN"])
15
 
16
  # Initialize the web search tool
17
  search_tool = DuckDuckGoSearchTool()