Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,17 +7,6 @@ from tools.final_answer import FinalAnswerTool
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
-
# Mon tool pour mon agent
|
| 11 |
-
@tool
|
| 12 |
-
def devine_mon_age(year_of_birth: int) -> str:
|
| 13 |
-
"""Devine l'âge à partir de l'année de naissance.
|
| 14 |
-
Args:
|
| 15 |
-
year_of_birth: année de naissance
|
| 16 |
-
"""
|
| 17 |
-
from datetime import datetime
|
| 18 |
-
age = datetime.now().year - year_of_birth
|
| 19 |
-
return f"Tu as environ {age} ans."
|
| 20 |
-
|
| 21 |
# Below is an example of a tool that does nothing. Amaze us with your creativity!
|
| 22 |
@tool
|
| 23 |
def my_custom_tool(arg1:str, arg2:int)-> str: # it's important to specify the return type
|
|
@@ -46,13 +35,12 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 46 |
|
| 47 |
|
| 48 |
final_answer = FinalAnswerTool()
|
| 49 |
-
# Ligne corrigée : pas d'indentation
|
| 50 |
model = InferenceClientModel(
|
| 51 |
max_tokens=2096,
|
| 52 |
temperature=0.5,
|
| 53 |
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
|
| 54 |
custom_role_conversions=None,
|
| 55 |
-
)
|
| 56 |
|
| 57 |
|
| 58 |
# Import tool from Hub
|
|
@@ -64,7 +52,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 64 |
|
| 65 |
agent = CodeAgent(
|
| 66 |
model=model,
|
| 67 |
-
tools=[final_answer
|
| 68 |
max_steps=6,
|
| 69 |
verbosity_level=1,
|
| 70 |
grammar=None,
|
|
|
|
| 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:str, arg2:int)-> str: # it's important to specify the return type
|
|
|
|
| 35 |
|
| 36 |
|
| 37 |
final_answer = FinalAnswerTool()
|
|
|
|
| 38 |
model = InferenceClientModel(
|
| 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 |
|
| 46 |
# Import tool from Hub
|
|
|
|
| 52 |
|
| 53 |
agent = CodeAgent(
|
| 54 |
model=model,
|
| 55 |
+
tools=[final_answer], # add your tools here (don't remove final_answer)
|
| 56 |
max_steps=6,
|
| 57 |
verbosity_level=1,
|
| 58 |
grammar=None,
|