Unverified Commit b7b6a60a authored by 高鑫崧's avatar 高鑫崧 Committed by GitHub
Browse files

Adapt the old parameter enable_thinking in chat_template_kwargs (#30852)


Signed-off-by: default avatarxinsong.gao <1418762819@qq.com>
Co-authored-by: default avatarChauncey <chaunceyjiang@gmail.com>
parent 9e67c4ce
...@@ -26,6 +26,8 @@ class DeepSeekV3ReasoningParser(ReasoningParser): ...@@ -26,6 +26,8 @@ class DeepSeekV3ReasoningParser(ReasoningParser):
chat_kwargs = kwargs.pop("chat_template_kwargs", {}) or {} chat_kwargs = kwargs.pop("chat_template_kwargs", {}) or {}
thinking = bool(chat_kwargs.pop("thinking", False)) thinking = bool(chat_kwargs.pop("thinking", False))
enable_thinking = bool(chat_kwargs.pop("enable_thinking", False))
thinking = thinking or enable_thinking
if thinking: if thinking:
self._parser = DeepSeekR1ReasoningParser(tokenizer, *args, **kwargs) self._parser = DeepSeekR1ReasoningParser(tokenizer, *args, **kwargs)
......
...@@ -50,6 +50,8 @@ class DeepseekV32Tokenizer(CachedHfTokenizer): ...@@ -50,6 +50,8 @@ class DeepseekV32Tokenizer(CachedHfTokenizer):
**kwargs, **kwargs,
) -> str | list[int]: ) -> str | list[int]:
thinking = kwargs.get("thinking", False) thinking = kwargs.get("thinking", False)
enable_thinking = kwargs.get("enable_thinking", False)
thinking = thinking or enable_thinking
thinking_mode = "thinking" thinking_mode = "thinking"
if not thinking: if not thinking:
thinking_mode = "chat" thinking_mode = "chat"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment