Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,17 +7,17 @@ from tools.final_answer import FinalAnswerTool
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
#
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
@tool
|
| 23 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
@@ -42,8 +42,8 @@ final_answer = FinalAnswerTool()
|
|
| 42 |
|
| 43 |
model = HfApiModel(
|
| 44 |
max_tokens=2096,
|
| 45 |
-
temperature=0.
|
| 46 |
-
model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud
|
| 47 |
# model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 48 |
custom_role_conversions=None,
|
| 49 |
)
|
|
@@ -58,13 +58,14 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 58 |
agent = CodeAgent(
|
| 59 |
model=model,
|
| 60 |
tools=[image_generation_tool, get_current_time_in_timezone,DuckDuckGoSearchTool(),final_answer], ## add your tools here (don't remove final answer)
|
| 61 |
-
max_steps=
|
| 62 |
verbosity_level=1,
|
| 63 |
grammar=None,
|
| 64 |
planning_interval=None,
|
| 65 |
name=None,
|
| 66 |
description=None,
|
| 67 |
-
prompt_templates=prompt_templates
|
|
|
|
| 68 |
)
|
| 69 |
|
| 70 |
|
|
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
+
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
+
@tool
|
| 12 |
+
def my_custom_tool(arg1:int, arg2:int)-> int: #it's import to specify the return type
|
| 13 |
+
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 14 |
+
"""A calculator to perform addition, subtraction and multiplication.
|
| 15 |
+
Args:
|
| 16 |
+
arg1: the first argument (e.g., 2)
|
| 17 |
+
arg2: the second argument (e.g., 5)
|
| 18 |
+
"""
|
| 19 |
|
| 20 |
+
return a + b or a-b or a*b
|
| 21 |
|
| 22 |
@tool
|
| 23 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 42 |
|
| 43 |
model = HfApiModel(
|
| 44 |
max_tokens=2096,
|
| 45 |
+
temperature=0.2,
|
| 46 |
+
model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 47 |
# model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 48 |
custom_role_conversions=None,
|
| 49 |
)
|
|
|
|
| 58 |
agent = CodeAgent(
|
| 59 |
model=model,
|
| 60 |
tools=[image_generation_tool, get_current_time_in_timezone,DuckDuckGoSearchTool(),final_answer], ## add your tools here (don't remove final answer)
|
| 61 |
+
max_steps=8,
|
| 62 |
verbosity_level=1,
|
| 63 |
grammar=None,
|
| 64 |
planning_interval=None,
|
| 65 |
name=None,
|
| 66 |
description=None,
|
| 67 |
+
prompt_templates=prompt_templates,
|
| 68 |
+
add_base_tools=True
|
| 69 |
)
|
| 70 |
|
| 71 |
|