Why doesn't the model generate |DSML|special tokens?
#29
by
Zchu
- opened
I manually encoded the messages using the encode_messages method from encoding_dsv32.py from the repository and made requests using the completion API, deployed by vLLM.
I noticed that the model-generated tool call content does not include the |DSML| special symbols, which causes parse_message_from_completion_text to fail when parsing tool calls.
Here's my code snippet:
messages = json.load(open("./encoding/test_input_search_wo_date.json"))["messages"][0:1]
encoded = encode_messages(messages, thinking_mode="thinking", context=None, drop_thinking=True, add_default_bos_token=True)
response = client.completions.create(
model="deepseek-v3.2",
prompt=encoded,
max_tokens=4096,
temperature=0.0,
)
response_text = response.choices[0].text
response_text:
...thinking content is parsed correct.</think>
<function_calls>
<invoke name="search">
<parameter name="query" string="true">rescinding previous administration’s plan to open most of the 22 million acres of the National Petroleum Reserve in Alaska to oil and gas drilling</parameter>
<parameter name="topn" string="false">10</parameter>
<parameter name="source" string="true">web</parameter>
</invoke>
</function_calls>
where the correct function call content format should be:
<|DSML|function_calls>
<|DSML|invoke name="search">....