fix grammar for Kimi-K2 (#1103)

* Update key-value separator and value end format

* Sample grammar first if resampling

---------

Co-authored-by: firecoperana <firecoperana>
This commit is contained in:
hksdpc255
2026-01-05 16:57:25 +11:00
committed by GitHub
parent 5a206e3cef
commit 3afd0600a1
2 changed files with 8 additions and 2 deletions

View File

@@ -1279,8 +1279,8 @@ static common_chat_params common_chat_params_init_kimi_k2(const common_chat_temp
form.tool_start = "<|tool_call_begin|>";
form.tool_sep = "<|tool_call_argument_begin|>{";
form.key_start = "\"";
form.key_val_sep = "\":";
form.val_end = ",";
form.key_val_sep = "\": ";
form.val_end = ", ";
form.tool_end = "}<|tool_call_end|>";
form.scope_end = "<|tool_calls_section_end|>";
form.raw_argval = false;