Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,9 +10,9 @@ from Gradio_UI import GradioUI
|
|
| 10 |
|
| 11 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 12 |
@tool
|
| 13 |
-
def
|
| 14 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 15 |
-
"""A tool that
|
| 16 |
Args:
|
| 17 |
temperature: The current temperature.
|
| 18 |
"""
|
|
@@ -48,7 +48,7 @@ web_search = DuckDuckGoSearchTool()
|
|
| 48 |
model = HfApiModel(
|
| 49 |
max_tokens=2096,
|
| 50 |
temperature=0.5,
|
| 51 |
-
model_id='
|
| 52 |
custom_role_conversions=None, # use default roles like user/assistant/etc
|
| 53 |
)
|
| 54 |
|
|
@@ -61,7 +61,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 61 |
|
| 62 |
agent = CodeAgent(
|
| 63 |
model=model,
|
| 64 |
-
tools=[final_answer, image_generation_tool, get_current_time_in_timezone, visit_page, web_search,
|
| 65 |
max_steps=6,
|
| 66 |
verbosity_level=1,
|
| 67 |
grammar=None,
|
|
|
|
| 10 |
|
| 11 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 12 |
@tool
|
| 13 |
+
def display_weather(temperature:str)-> str: #it's import to specify the return type
|
| 14 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 15 |
+
"""A tool that displays weather in Degrees Celsius.
|
| 16 |
Args:
|
| 17 |
temperature: The current temperature.
|
| 18 |
"""
|
|
|
|
| 48 |
model = HfApiModel(
|
| 49 |
max_tokens=2096,
|
| 50 |
temperature=0.5,
|
| 51 |
+
model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud',# it is possible that this model may be overloaded
|
| 52 |
custom_role_conversions=None, # use default roles like user/assistant/etc
|
| 53 |
)
|
| 54 |
|
|
|
|
| 61 |
|
| 62 |
agent = CodeAgent(
|
| 63 |
model=model,
|
| 64 |
+
tools=[final_answer, image_generation_tool, get_current_time_in_timezone, visit_page, web_search, display_weather], ## add your tools here (don't remove final answer)
|
| 65 |
max_steps=6,
|
| 66 |
verbosity_level=1,
|
| 67 |
grammar=None,
|