cli : fix --reasoning-budget and --chat-template-kwargs being ignored
The autoparser refactor (#18675) replaced `chat_params.enable_thinking` with `common_chat_templates_support_enable_thinking()`, which only checks template support and ignores the user's flags. Also missing was the chat_template_kwargs passthrough. Fixes #20182
This commit is contained in:
parent
c96f608d98
commit
e0e9c747a7
|
|
@ -193,7 +193,20 @@ struct cli_context {
|
||||||
inputs.parallel_tool_calls = false;
|
inputs.parallel_tool_calls = false;
|
||||||
inputs.add_generation_prompt = true;
|
inputs.add_generation_prompt = true;
|
||||||
inputs.reasoning_format = COMMON_REASONING_FORMAT_DEEPSEEK;
|
inputs.reasoning_format = COMMON_REASONING_FORMAT_DEEPSEEK;
|
||||||
inputs.enable_thinking = common_chat_templates_support_enable_thinking(chat_params.tmpls.get());
|
inputs.enable_thinking = chat_params.enable_thinking;
|
||||||
|
inputs.chat_template_kwargs = chat_params.chat_template_kwargs;
|
||||||
|
|
||||||
|
// sync enable_thinking with kwargs (mirrors server-common.cpp)
|
||||||
|
{
|
||||||
|
auto it = inputs.chat_template_kwargs.find("enable_thinking");
|
||||||
|
if (it != inputs.chat_template_kwargs.end()) {
|
||||||
|
if (it->second == "true") {
|
||||||
|
inputs.enable_thinking = true;
|
||||||
|
} else if (it->second == "false") {
|
||||||
|
inputs.enable_thinking = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Apply chat template to the list of messages
|
// Apply chat template to the list of messages
|
||||||
return common_chat_templates_apply(chat_params.tmpls.get(), inputs);
|
return common_chat_templates_apply(chat_params.tmpls.get(), inputs);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue