Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ from typing import List
|
|
| 7 |
|
| 8 |
from langchain.text_splitter import CharacterTextSplitter
|
| 9 |
from tools.final_answer import FinalAnswerTool
|
| 10 |
-
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, tool
|
| 11 |
from Gradio_UI import GradioUI
|
| 12 |
|
| 13 |
# === TOOLS ===
|
|
@@ -72,12 +72,11 @@ model_config = agent_config["model"]["data"]
|
|
| 72 |
# === BUILD MODEL ===
|
| 73 |
from smolagents import HfApiModel
|
| 74 |
|
| 75 |
-
model =
|
| 76 |
-
model_id="
|
| 77 |
-
|
| 78 |
temperature=0.5,
|
| 79 |
max_tokens=1024,
|
| 80 |
-
custom_role_conversions=None,
|
| 81 |
)
|
| 82 |
|
| 83 |
model.last_input_token_count = 0
|
|
|
|
| 7 |
|
| 8 |
from langchain.text_splitter import CharacterTextSplitter
|
| 9 |
from tools.final_answer import FinalAnswerTool
|
| 10 |
+
from smolagents import CodeAgent, LiteLLMModel, DuckDuckGoSearchTool, HfApiModel, load_tool, tool
|
| 11 |
from Gradio_UI import GradioUI
|
| 12 |
|
| 13 |
# === TOOLS ===
|
|
|
|
| 72 |
# === BUILD MODEL ===
|
| 73 |
from smolagents import HfApiModel
|
| 74 |
|
| 75 |
+
model = LiteLLMModel(
|
| 76 |
+
model_id="gemini/gemini-2.0-flash-lite",
|
| 77 |
+
api_key=os.getenv("GEMINI_API_KEY"),
|
| 78 |
temperature=0.5,
|
| 79 |
max_tokens=1024,
|
|
|
|
| 80 |
)
|
| 81 |
|
| 82 |
model.last_input_token_count = 0
|