<think> tags are still present even when enable_thinking=False

#11
by clam004 - opened

when i turn it off

text = tokenizer.apply_chat_template(
    messages_list,
    tokenize=False,
    add_generation_prompt=False,
    enable_thinking=False # Switches between thinking and non-thinking modes. Default is True.
)

the format is still

<|im_start|>assistant
<think>

</think>

Yeah mate, that's how Qwen3 works.

See the end of this line: https://huggingface.co/Qwen/Qwen3-1.7B/blob/main/tokenizer_config.json#L230

{{- '<|im_start|>assistant\\n' }}\n    {%- if enable_thinking is defined and enable_thinking is false %}\n        {{- '<think>\\n\\n</think>\\n\\n' }}\n    {%- endif %}\n{%- endif %}"

Sign up or log in to comment