mirror of
https://github.com/ikawrakow/ik_llama.cpp.git
synced 2026-04-30 19:31:48 +00:00
fix v1/chat/completions assistant prefill (#874)
This commit is contained in:
@@ -591,6 +591,17 @@ static json oaicompat_chat_params_parse(
|
|||||||
|
|
||||||
// Apply chat template to the list of messages
|
// Apply chat template to the list of messages
|
||||||
auto chat_params = common_chat_templates_apply(opt.tmpls, inputs);
|
auto chat_params = common_chat_templates_apply(opt.tmpls, inputs);
|
||||||
|
|
||||||
|
/* Append assistant prefilled message */
|
||||||
|
if (prefill_assistant_message) {
|
||||||
|
if (!last_message.content_parts.empty()) {
|
||||||
|
for (auto & p : last_message.content_parts) {
|
||||||
|
chat_params.prompt += p.text;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
chat_params.prompt += last_message.content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
llama_params["chat_format"] = static_cast<int>(chat_params.format);
|
llama_params["chat_format"] = static_cast<int>(chat_params.format);
|
||||||
llama_params["prompt"] = chat_params.prompt;
|
llama_params["prompt"] = chat_params.prompt;
|
||||||
|
|||||||
Reference in New Issue
Block a user