Fix chat template including thinking token
The original chat template mask {% generation %} tag wrongly. I supposed that the original version was copied from other Qwen3 models that requires reasoning. This model, however, doesn't contain thinking tag, making finetuning with this tokenizer under --assistant_only_loss resulted in wrong assistant masking. This change fix the incorporation of think token for instruction model while also allowing proper masking for instruction tuning.
Yup. Not only that, i trained it with the correct masking with "train_on_responses_only" but the thinking tokens in the sequence make the loss way higher on the training set and the final performances on the eval dataset worse.
Obv you can fix it with something like the following code:
_tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-4B-Instruct-2507" )
tokenizer.chat_template = _tokenizer.chat_template
Btw, thanks a lot for the great work! I love you <3.