Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,13 +33,21 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 33 |
except Exception as e:
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
final_answer = FinalAnswerTool()
|
| 38 |
-
model = HfApiModel(
|
| 39 |
-
max_tokens=2096,
|
| 40 |
-
temperature=0.5,
|
| 41 |
-
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
|
| 42 |
-
custom_role_conversions=None,
|
| 43 |
)
|
| 44 |
|
| 45 |
|
|
@@ -51,7 +59,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 51 |
|
| 52 |
agent = CodeAgent(
|
| 53 |
model=model,
|
| 54 |
-
tools=[final_answer], ## add your tools here (don't remove final answer)
|
| 55 |
max_steps=6,
|
| 56 |
verbosity_level=1,
|
| 57 |
grammar=None,
|
|
|
|
| 33 |
except Exception as e:
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
| 36 |
+
@tool
|
| 37 |
+
def division_tool(a: float, b: float) -> float:
|
| 38 |
+
"""A tool that divides two numbers a / b
|
| 39 |
+
Args:
|
| 40 |
+
a: a number
|
| 41 |
+
b: a number to divide number a by
|
| 42 |
+
"""
|
| 43 |
+
return a / b
|
| 44 |
|
| 45 |
final_answer = FinalAnswerTool()
|
| 46 |
+
model = HfApiModel(
|
| 47 |
+
max_tokens=2096,
|
| 48 |
+
temperature=0.5,
|
| 49 |
+
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
|
| 50 |
+
custom_role_conversions=None,
|
| 51 |
)
|
| 52 |
|
| 53 |
|
|
|
|
| 59 |
|
| 60 |
agent = CodeAgent(
|
| 61 |
model=model,
|
| 62 |
+
tools=[final_answer, image_generation_tool, DuckDuckGoSearchTool], ## add your tools here (don't remove final answer)
|
| 63 |
max_steps=6,
|
| 64 |
verbosity_level=1,
|
| 65 |
grammar=None,
|