renwei2024 commited on
Commit
5e50775
·
verified ·
1 Parent(s): 9570ac3

Replace the default Hugging Face model with Gemini-2.0-flash-lite

Browse files
Files changed (1) hide show
  1. app.py +6 -2
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 os
3
  import random
4
+ from smolagents import GradioUI, CodeAgent, HfApiModel, LiteLLMModel
5
 
6
  # Import our custom tools from their modules
7
  from tools import DuckDuckGoSearchTool, WeatherInfoTool, HubStatsTool
8
  from retriever import load_guest_dataset
9
 
10
  # Initialize the Hugging Face model
11
+ model = LiteLLMModel(
12
+ model_id="gemini/gemini-2.0-flash-lite",
13
+ api_key=os.getenv("GEMINI_API_TOKEN")
14
+ )
15
 
16
  # Initialize the web search tool
17
  search_tool = DuckDuckGoSearchTool()