Adapt the old parameter enable_thinking in chat_template_kwargs (#30852)

Signed-off-by: xinsong.gao <1418762819@qq.com>
Co-authored-by: Chauncey <chaunceyjiang@gmail.com>
This commit is contained in:
高鑫崧 2025-12-17 23:10:59 +08:00 committed by GitHub
parent 9e67c4ce98
commit b7b6a60aca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -26,6 +26,8 @@ class DeepSeekV3ReasoningParser(ReasoningParser):
chat_kwargs = kwargs.pop("chat_template_kwargs", {}) or {}
thinking = bool(chat_kwargs.pop("thinking", False))
enable_thinking = bool(chat_kwargs.pop("enable_thinking", False))
thinking = thinking or enable_thinking
if thinking:
self._parser = DeepSeekR1ReasoningParser(tokenizer, *args, **kwargs)

View File

@ -50,6 +50,8 @@ class DeepseekV32Tokenizer(CachedHfTokenizer):
**kwargs,
) -> str | list[int]:
thinking = kwargs.get("thinking", False)
enable_thinking = kwargs.get("enable_thinking", False)
thinking = thinking or enable_thinking
thinking_mode = "thinking"
if not thinking:
thinking_mode = "chat"