[Bugfix] Align deepseek v4 parser thinking default with tokenizer (#51296)

Signed-off-by: sfeng33 <4florafeng@gmail.com>
This commit is contained in:
Flora Feng
2026-08-10 19:30:30 +00:00
committed by GitHub
parent d40c3e3c00
commit 3f142bd85e
3 changed files with 57 additions and 12 deletions
+5 -3
View File
@@ -217,10 +217,12 @@ class DeepSeekV4Parser(ParserEngine):
**kwargs,
) -> None:
chat_kwargs = kwargs.pop("chat_template_kwargs", None) or {}
thinking = (
bool(chat_kwargs.get("thinking") or chat_kwargs.get("enable_thinking"))
and chat_kwargs.get("reasoning_effort") != "none"
thinking = bool(
chat_kwargs.get("thinking") or chat_kwargs.get("enable_thinking")
)
if "thinking" not in chat_kwargs and "enable_thinking" not in chat_kwargs:
thinking = True
thinking = thinking and chat_kwargs.get("reasoning_effort") != "none"
super().__init__(
tokenizer,
tools,