Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from smolagents import CodeAgent, DuckDuckGoSearchTool,
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
|
@@ -39,11 +39,10 @@ def get_weather(city: str) -> str:
|
|
| 39 |
final_answer = FinalAnswerTool()
|
| 40 |
|
| 41 |
# ------------------- MODEL CONFIG -------------------
|
| 42 |
-
model =
|
| 43 |
max_tokens=2096,
|
| 44 |
temperature=0.5,
|
| 45 |
-
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
|
| 46 |
-
custom_role_conversions=None,
|
| 47 |
)
|
| 48 |
|
| 49 |
# ------------------- IMAGE GENERATION TOOL -------------------
|
|
@@ -57,7 +56,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 57 |
agent = CodeAgent(
|
| 58 |
model=model,
|
| 59 |
tools=[
|
| 60 |
-
final_answer,
|
| 61 |
DuckDuckGoSearchTool(), # optional: search
|
| 62 |
image_generation_tool,
|
| 63 |
get_weather,
|
|
@@ -75,3 +74,4 @@ agent = CodeAgent(
|
|
| 75 |
|
| 76 |
# ------------------- LAUNCH APP -------------------
|
| 77 |
GradioUI(agent).launch()
|
|
|
|
|
|
| 1 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, HFModel, load_tool, tool
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
|
|
|
| 39 |
final_answer = FinalAnswerTool()
|
| 40 |
|
| 41 |
# ------------------- MODEL CONFIG -------------------
|
| 42 |
+
model = HFModel(
|
| 43 |
max_tokens=2096,
|
| 44 |
temperature=0.5,
|
| 45 |
+
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
|
|
|
|
| 46 |
)
|
| 47 |
|
| 48 |
# ------------------- IMAGE GENERATION TOOL -------------------
|
|
|
|
| 56 |
agent = CodeAgent(
|
| 57 |
model=model,
|
| 58 |
tools=[
|
| 59 |
+
final_answer,
|
| 60 |
DuckDuckGoSearchTool(), # optional: search
|
| 61 |
image_generation_tool,
|
| 62 |
get_weather,
|
|
|
|
| 74 |
|
| 75 |
# ------------------- LAUNCH APP -------------------
|
| 76 |
GradioUI(agent).launch()
|
| 77 |
+
|