Write typed tool-call arguments as JSON and add a response template

#55
by Rocketknight1 HF Staff - opened

Writes tool-call arguments that aren't strings as JSON (true, null) instead of Python's True/None, as Qwen3.6's template does, and removes the duplicate copy of the template from tokenizer_config.json. It should work in Transformers, llama.cpp and vLLM. Also adds a response template, so Transformers' parse_response turns the model's output back into a message (reasoning, content and tool calls), matching vLLM's own Qwen parser. The chat template also marks the assistant's output with {% generation %} tags, so return_assistant_tokens_mask (TRL's assistant_only_loss) trains on just that; the tags don't change the rendered text.

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment