mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-05-25 14:53:39 +00:00
server: only parse empty msg if continuing an assistant msg (#23506)
This commit is contained in:
parent
ef570f6308
commit
1acee6bf89
2 changed files with 6 additions and 1 deletions
|
|
@ -149,7 +149,7 @@ task_result_state::task_result_state(const common_chat_parser_params & chat_pars
|
|||
, oai_resp_id("resp_" + random_string())
|
||||
, oai_resp_reasoning_id("rs_" + random_string())
|
||||
, oai_resp_message_id("msg_" + random_string()) {
|
||||
if (!chat_parser_params.echo) {
|
||||
if (chat_parser_params.is_continuation && !chat_parser_params.echo) {
|
||||
// initialize chat_msg to avoid emitting a delta containing the assistant prefill
|
||||
chat_msg = common_chat_parse("", true, chat_parser_params);
|
||||
}
|
||||
|
|
@ -432,6 +432,10 @@ task_params server_task::params_from_json_cmpl(
|
|||
if (data.contains("chat_parser")) {
|
||||
params.chat_parser_params.parser.load(data.at("chat_parser").get<std::string>());
|
||||
}
|
||||
if (data.contains("continue_final_message")) {
|
||||
auto continuation = common_chat_continuation_parse(data.at("continue_final_message"));
|
||||
params.chat_parser_params.is_continuation = continuation != COMMON_CHAT_CONTINUATION_NONE;
|
||||
}
|
||||
params.chat_parser_params.echo = json_value(data, "echo", false);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue