Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,11 +23,10 @@ def get_converted_speed(unit:str, speed:float)-> float: #it's import to specify
|
|
| 23 |
elif unit == "mph":
|
| 24 |
converted_speed = speed / factor
|
| 25 |
else:
|
| 26 |
-
|
| 27 |
|
| 28 |
return converted_speed
|
| 29 |
|
| 30 |
-
|
| 31 |
final_answer = FinalAnswerTool()
|
| 32 |
|
| 33 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
|
@@ -49,7 +48,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 49 |
|
| 50 |
agent = CodeAgent(
|
| 51 |
model=model,
|
| 52 |
-
tools=[final_answer], ## add your tools here (don't remove final answer)
|
| 53 |
max_steps=6,
|
| 54 |
verbosity_level=1,
|
| 55 |
grammar=None,
|
|
|
|
| 23 |
elif unit == "mph":
|
| 24 |
converted_speed = speed / factor
|
| 25 |
else:
|
| 26 |
+
raise ValueError(f"Invalid unit: {unit}. Please use 'kph' or 'mph'.")
|
| 27 |
|
| 28 |
return converted_speed
|
| 29 |
|
|
|
|
| 30 |
final_answer = FinalAnswerTool()
|
| 31 |
|
| 32 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
|
|
|
| 48 |
|
| 49 |
agent = CodeAgent(
|
| 50 |
model=model,
|
| 51 |
+
tools=[final_answer, get_converted_speed], ## add your tools here (don't remove final answer)
|
| 52 |
max_steps=6,
|
| 53 |
verbosity_level=1,
|
| 54 |
grammar=None,
|