Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from smolagents import Tool, FinalAnswerTool, ToolCallingAgent, DuckDuckGoSearchTool, tool, LiteLLMModel, PythonInterpreterTool
|
| 2 |
import datetime
|
| 3 |
import requests
|
|
@@ -34,7 +37,10 @@ def sub_tool(a: float, b: float) -> float:
|
|
| 34 |
|
| 35 |
final_answer = FinalAnswerTool()
|
| 36 |
|
| 37 |
-
model = LiteLLMModel(
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
agent = ToolCallingAgent(
|
| 40 |
tools=[sum_tool, sub_tool, PythonInterpreterTool()],
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 4 |
from smolagents import Tool, FinalAnswerTool, ToolCallingAgent, DuckDuckGoSearchTool, tool, LiteLLMModel, PythonInterpreterTool
|
| 5 |
import datetime
|
| 6 |
import requests
|
|
|
|
| 37 |
|
| 38 |
final_answer = FinalAnswerTool()
|
| 39 |
|
| 40 |
+
model = LiteLLMModel(
|
| 41 |
+
model_id="huggingface/google/gemma-2-2b-it",
|
| 42 |
+
api_key=HF_TOKEN
|
| 43 |
+
)
|
| 44 |
|
| 45 |
agent = ToolCallingAgent(
|
| 46 |
tools=[sum_tool, sub_tool, PythonInterpreterTool()],
|