Spaces:
Sleeping
Sleeping
clementmandron
commited on
Commit
·
1770d69
1
Parent(s):
2bbd0e5
first
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
-
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
|
|
|
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
|
@@ -40,14 +41,14 @@ final_answer = FinalAnswerTool()
|
|
| 40 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
| 41 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 42 |
|
| 43 |
-
model =
|
| 44 |
max_tokens=2096,
|
| 45 |
temperature=0.5,
|
| 46 |
-
model_id=
|
| 47 |
custom_role_conversions=None,
|
|
|
|
| 48 |
)
|
| 49 |
|
| 50 |
-
|
| 51 |
# Import tool from Hub
|
| 52 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 53 |
|
|
|
|
| 1 |
+
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool, LiteLLMModel
|
| 2 |
+
import os
|
| 3 |
import datetime
|
| 4 |
import requests
|
| 5 |
import pytz
|
|
|
|
| 41 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
| 42 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 43 |
|
| 44 |
+
model = LiteLLMModel(
|
| 45 |
max_tokens=2096,
|
| 46 |
temperature=0.5,
|
| 47 |
+
model_id="gemini/gemini-2.0-flash-lite",# it is possible that this model may be overloaded
|
| 48 |
custom_role_conversions=None,
|
| 49 |
+
api_key=os.getenv(key="GEMINI_API_KEY"),
|
| 50 |
)
|
| 51 |
|
|
|
|
| 52 |
# Import tool from Hub
|
| 53 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 54 |
|