Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
-
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
|
2 |
import datetime
|
3 |
import requests
|
4 |
import pytz
|
5 |
import yaml
|
6 |
from tools.final_answer import FinalAnswerTool
|
7 |
from typing import Tuple
|
|
|
8 |
|
9 |
from Gradio_UI import GradioUI
|
10 |
|
@@ -47,13 +48,19 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
47 |
|
48 |
|
49 |
final_answer = FinalAnswerTool()
|
50 |
-
model = HfApiModel(
|
51 |
-
max_tokens=2096,
|
52 |
-
temperature=0.5,
|
53 |
-
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
54 |
-
custom_role_conversions=None,
|
55 |
-
)
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
# Import tool from Hub
|
59 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
|
|
1 |
+
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel, load_tool, tool, LiteLLMModel
|
2 |
import datetime
|
3 |
import requests
|
4 |
import pytz
|
5 |
import yaml
|
6 |
from tools.final_answer import FinalAnswerTool
|
7 |
from typing import Tuple
|
8 |
+
import os
|
9 |
|
10 |
from Gradio_UI import GradioUI
|
11 |
|
|
|
48 |
|
49 |
|
50 |
final_answer = FinalAnswerTool()
|
51 |
+
# model = HfApiModel(
|
52 |
+
# max_tokens=2096,
|
53 |
+
# temperature=0.5,
|
54 |
+
# model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
55 |
+
# custom_role_conversions=None,
|
56 |
+
# )
|
57 |
|
58 |
+
model = LiteLLMModel(
|
59 |
+
model_id = "gemini/gemini-2.0-flash",
|
60 |
+
api_key = os.getenv("GEMINI_API_KEY"),
|
61 |
+
temperature = 1,
|
62 |
+
max_tokens=4096
|
63 |
+
)
|
64 |
|
65 |
# Import tool from Hub
|
66 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|