mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-09 22:55:51 +08:00
[Bugfix] fixed deepseekv32 tool calling error (#30025)
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com> Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
This commit is contained in:
parent
9ae2f60374
commit
82a64b3d8f
@ -95,8 +95,10 @@ def tool_calls_to_openai_format(tool_calls):
|
||||
def encode_arguments_to_dsml(tool_call: dict[str, str]) -> str:
|
||||
p_dsml_template = """<{dsml_token}parameter name="{key}" string="{is_str}">{value}</{dsml_token}parameter>"""
|
||||
P_dsml_strs = []
|
||||
|
||||
arguments = json.loads(tool_call["arguments"])
|
||||
if isinstance(tool_call["arguments"], str):
|
||||
arguments = json.loads(tool_call["arguments"])
|
||||
else:
|
||||
arguments = tool_call["arguments"]
|
||||
|
||||
for k, v in arguments.items():
|
||||
p_dsml_str = p_dsml_template.format(
|
||||
|
||||
@ -43,7 +43,8 @@ class DeepseekV32Tokenizer(HfTokenizer):
|
||||
thinking_mode = "thinking"
|
||||
if not thinking:
|
||||
thinking_mode = "chat"
|
||||
messages = messages.copy()
|
||||
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"})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user