Spaces:
Sleeping
Sleeping
Updated
Browse files
app.py
CHANGED
|
@@ -24,12 +24,27 @@ def suggest_menu(occasion: str) -> str:
|
|
| 24 |
else:
|
| 25 |
return "Custom menu for the butler."
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
-
# Alfred, the butler, preparing the menu for the party
|
| 32 |
-
agent = CodeAgent(tools=[suggest_menu], model=HfApiModel())
|
| 33 |
-
agent.run("Prepare a formal menu for the party.")
|
| 34 |
|
| 35 |
GradioUI(agent).launch()
|
|
|
|
| 24 |
else:
|
| 25 |
return "Custom menu for the butler."
|
| 26 |
|
| 27 |
+
model = HfApiModel(
|
| 28 |
+
max_tokens=2096,
|
| 29 |
+
temperature=0.5,
|
| 30 |
+
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 31 |
+
custom_role_conversions=None,
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
with open("prompts.yaml", 'r') as stream:
|
| 35 |
+
prompt_templates = yaml.safe_load(stream)
|
| 36 |
+
|
| 37 |
+
agent = CodeAgent(
|
| 38 |
+
model=model,
|
| 39 |
+
tools=[get_current_time_in_timezone,final_answer], ## add your tools here (don't remove final answer)
|
| 40 |
+
max_steps=6,
|
| 41 |
+
verbosity_level=1,
|
| 42 |
+
grammar=None,
|
| 43 |
+
planning_interval=None,
|
| 44 |
+
name=None,
|
| 45 |
+
description=None,
|
| 46 |
+
prompt_templates=prompt_templates
|
| 47 |
+
)
|
| 48 |
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
GradioUI(agent).launch()
|