Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, load_tool, tool
|
|
|
|
| 2 |
import datetime
|
| 3 |
import pytz
|
| 4 |
import yaml
|
|
@@ -28,7 +29,9 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 28 |
|
| 29 |
final_answer = FinalAnswerTool()
|
| 30 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 31 |
-
|
|
|
|
|
|
|
| 32 |
|
| 33 |
with open("prompts.yaml", "r") as stream:
|
| 34 |
prompt_templates = yaml.safe_load(stream)
|
|
@@ -39,16 +42,4 @@ agent = CodeAgent(
|
|
| 39 |
DuckDuckGoSearchTool(),
|
| 40 |
image_generation_tool,
|
| 41 |
my_custom_tool,
|
| 42 |
-
|
| 43 |
-
final_answer
|
| 44 |
-
],
|
| 45 |
-
max_steps=6,
|
| 46 |
-
verbosity_level=1,
|
| 47 |
-
grammar=None,
|
| 48 |
-
planning_interval=None,
|
| 49 |
-
prompt_templates=prompt_templates
|
| 50 |
-
)
|
| 51 |
-
|
| 52 |
-
print("🚀 Agent starting...")
|
| 53 |
-
GradioUI(agent).launch()
|
| 54 |
-
print("✅ Gradio launched!")
|
|
|
|
| 1 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, load_tool, tool
|
| 2 |
+
from huggingface_hub.inference._client import InferenceClient
|
| 3 |
import datetime
|
| 4 |
import pytz
|
| 5 |
import yaml
|
|
|
|
| 29 |
|
| 30 |
final_answer = FinalAnswerTool()
|
| 31 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 32 |
+
|
| 33 |
+
# Set up InferenceClient as the model
|
| 34 |
+
model = InferenceClient("Qwen/Qwen2.5-Coder-32B-Instruct")
|
| 35 |
|
| 36 |
with open("prompts.yaml", "r") as stream:
|
| 37 |
prompt_templates = yaml.safe_load(stream)
|
|
|
|
| 42 |
DuckDuckGoSearchTool(),
|
| 43 |
image_generation_tool,
|
| 44 |
my_custom_tool,
|
| 45 |
+
get_current_time_in_timezo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|