Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions vllm/reasoning/deepseek_v3_reasoning_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class DeepSeekV3ReasoningParser(ReasoningParser):
def __init__(self, tokenizer: PreTrainedTokenizerBase, *args, **kwargs):
super().__init__(tokenizer, *args, **kwargs)

chat_kwargs = kwargs.pop("chat_template_kwargs", {}) or {}
thinking = bool(chat_kwargs.pop("thinking", False))
enable_thinking = bool(chat_kwargs.pop("enable_thinking", False))
chat_kwargs = kwargs.get("chat_template_kwargs", {}) or {}
thinking = bool(chat_kwargs.get("thinking", False))
enable_thinking = bool(chat_kwargs.get("enable_thinking", False))
thinking = thinking or enable_thinking

if thinking:
Expand Down
7 changes: 4 additions & 3 deletions vllm/reasoning/glm4_moe_reasoning_parser.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project

from vllm.reasoning.deepseek_r1_reasoning_parser import DeepSeekR1ReasoningParser
from vllm.reasoning.holo2_reasoning_parser import Holo2ReasoningParser


class Glm4MoeModelReasoningParser(DeepSeekR1ReasoningParser):
class Glm4MoeModelReasoningParser(Holo2ReasoningParser):
"""
Reasoning parser for the Glm4MoeModel model is same as DeepSeekR1ReasoningParser.
Reasoning parser for the Glm4MoeModel model,which inherits from
`Holo2ReasoningParser`.
"""

pass
7 changes: 4 additions & 3 deletions vllm/reasoning/holo2_reasoning_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ def __init__(self, tokenizer: TokenizerLike, *args, **kwargs):
# all requests in the structured output manager. So it is important that without
# user specified chat template args, the default thinking is True.

enable_thinking = bool(chat_kwargs.get("thinking", True))

if enable_thinking:
thinking = bool(chat_kwargs.get("thinking", True))
enable_thinking = bool(chat_kwargs.get("enable_thinking", True))
thinking = thinking and enable_thinking
if thinking:
self._parser = DeepSeekR1ReasoningParser(tokenizer, *args, **kwargs)
else:
self._parser = IdentityReasoningParser(tokenizer, *args, **kwargs)
Expand Down