Add a response template and generation tags

#81
by Rocketknight1 HF Staff - opened

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. Also removes the duplicate copy of the chat template from tokenizer_config.json. 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.

Rocketknight1 changed pull request title from Add a response template to Add a response template and generation tags
VoyagerXHF changed pull request status to merged

Sign up or log in to comment