Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,26 @@
|
|
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 |
-
model = HfApiModel(
|
10 |
-
max_tokens=2096,
|
11 |
-
temperature=0,
|
12 |
-
model_id='mistralai/Mistral-7B-Instruct-v0.3',
|
13 |
-
custom_role_conversions=None,
|
14 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
# Initialize the web search tool
|
17 |
search_tool = DuckDuckGoSearchTool()
|
|
|
1 |
import gradio as gr
|
2 |
import random
|
3 |
+
from smolagents import GradioUI, CodeAgent, HfApiModel, LiteLLMModel
|
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 |
+
#model = HfApiModel(
|
10 |
+
# max_tokens=2096,
|
11 |
+
# temperature=0,
|
12 |
+
# model_id='mistralai/Mistral-7B-Instruct-v0.3',
|
13 |
+
# custom_role_conversions=None,
|
14 |
+
#)
|
15 |
+
|
16 |
+
|
17 |
+
hf_api = HfApi()
|
18 |
+
secrets = hf_api.get_secrets()
|
19 |
+
|
20 |
+
model = LiteLLMModel(
|
21 |
+
model_id="gemini/gemini-2.0-flash-lite",
|
22 |
+
api_key=secrets.get("GEMINI_API_TOKEN")
|
23 |
+
)
|
24 |
|
25 |
# Initialize the web search tool
|
26 |
search_tool = DuckDuckGoSearchTool()
|