Skip to content

qwen3 tokenizer think token #2923

@00HS

Description

@00HS

In the Hugging Face Qwen3-8B code, I see the following:

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

From the docs, it looks like enable_thinking toggles thinking vs. non-thinking modes.
When I train with torchtune, the tokenizer seems to inherit from the Qwen2 tokenizer.

My questions are:

Does this mean the default setting already includes thinking mode?

At inference time, is there a way to disable/remove thinking mode when using this tokenizer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions