You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as explained by @Rocketknight1 in tools use, unified,all newer models were expected to come with tool use supported by their tokenizer with XML tags like <tool>, but that's not the case.
Qwens chat template does support it:
<|im_start|>systemYouareahelpfulassistant.
# ToolsYoumaycalloneormorefunctionstoassistwiththeuserquery.
Youareprovidedwithfunctionsignatureswithin<tools></tools>XMLtags:
<tools>
{"type": "function", "function": {"name": "get_current_temperature", "description": "Gets the temperature at a given location.", "parameters": {"type": "object", "properties": {"location": {"type": "string", "description": "The location to get the temperature for"}}, "required": ["location"]}}}
</tools>Foreachfunctioncall, returnajsonobjectwithfunctionnameandargumentswithin<tool_call></tool_call>XMLtags:
<tool_call>
{"name": <function-name>, "arguments": <args-json-object>}
</tool_call><|im_end|><|im_start|>userWhatisthecurrenttempratureinlondon?<|im_end|><|im_start|>assistant
Not all models are expected to support tool use! When they do support tool use, we encourage support for that in their chat template, but I'm not sure if models like Deepseek-R1 are trained to use tools.
as explained by @Rocketknight1 in tools use, unified,all newer models were expected to come with tool use supported by their tokenizer with XML tags like
<tool>
, but that's not the case.Qwens chat template does support it:
while R1 doesn't:
and some other models like Llama do create JSON schemas but have misleading prompts and don't prompt the model to use the XML tags:
This situation could lead to complications when training agents, particularly when it comes to using the trained agents afterward.
It is essential that:
any ideas on how to implement this?
The text was updated successfully, but these errors were encountered: