A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 11, 13:45 UTC
[DeepSeek V3.2] Proper drop_thinking logic (#30490)
Signed-off-by: Vladislav Nosivskoy <vladnosiv@gmail.com>
Vladislav Nosivskoy committed
Dec 12, 2025 at 18:01 UTC
3e34adcdfb1e3845e2fc4d0cd192d314eab516f0
1 file changed
+4
-2
vllm/tokenizers/deepseekv32.py
+4
-2
@@ -47,11 +47,13 @@ class DeepseekV32Tokenizer(HfTokenizer):
47
thinking_mode = "chat"
48
conversation = kwargs.get("conversation", messages)
49
messages = conversation.copy()
50
- drop_thinking = True
50
if tools is not None and len(tools) > 0:
51
messages.insert(0, {"role": "system"})
52
messages[0]["tools"] = tools
54
- drop_thinking = False
53
+
54
+ # Historical reasoning content is dropped when a new user message is introduced
55
+ drop_thinking = messages[-1]["role"] == "user"
56
+
57
encode_config = dict(thinking_mode=thinking_mode, drop_thinking=drop_thinking)
58
prompt_str = encode_messages(messages, **encode_config) # type: ignore
59
return prompt_str