"vllm/executor/mp_distributed_executor.py" did not exist on "1dab9bc8a9192a6081821c3a6b6c4aee3b7912c3"
Unverified Commit 3e34adcd authored by Vladislav Nosivskoy's avatar Vladislav Nosivskoy Committed by GitHub
Browse files

[DeepSeek V3.2] Proper drop_thinking logic (#30490)


Signed-off-by: default avatarVladislav Nosivskoy <vladnosiv@gmail.com>
parent 3e41992f
......@@ -47,11 +47,13 @@ class DeepseekV32Tokenizer(HfTokenizer):
thinking_mode = "chat"
conversation = kwargs.get("conversation", messages)
messages = conversation.copy()
drop_thinking = True
if tools is not None and len(tools) > 0:
messages.insert(0, {"role": "system"})
messages[0]["tools"] = tools
drop_thinking = False
# Historical reasoning content is dropped when a new user message is introduced
drop_thinking = messages[-1]["role"] == "user"
encode_config = dict(thinking_mode=thinking_mode, drop_thinking=drop_thinking)
prompt_str = encode_messages(messages, **encode_config) # type: ignore
return prompt_str
......
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