Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions vllm/reasoning/qwen3_reasoning_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ class Qwen3ReasoningParser(BaseThinkingReasoningParser):
def __init__(self, tokenizer, *args, **kwargs):
super().__init__(tokenizer, *args, **kwargs)
chat_kwargs = kwargs.get("chat_template_kwargs", {}) or {}
# Qwen3.5 chat templates open the <think> block in the prompt when
# thinking is enabled, so completion tokens may only contain </think>.
self.prompt_has_open_think = bool(chat_kwargs.get("enable_thinking", False))
# The standard Qwen3 chat template injects <think>\n into the prompt
# whenever enable_thinking is not explicitly False, so completion tokens
# may only contain </think>. Default to True and only honor an explicit
# enable_thinking=False to opt out.
self.prompt_has_open_think = bool(chat_kwargs.get("enable_thinking", True))

@property
def start_token(self) -> str:
Expand Down
Loading