server: fix formatted_chat

This commit is contained in:
ngxson 2024-02-20 15:20:46 +01:00
parent 5912bb50bb
commit 235736b176

View file

@ -204,7 +204,7 @@ inline std::string format_chat(const struct llama_model * model, const std::stri
res = llama_chat_apply_template(model, ptr_tmpl, chat.data(), chat.size(), true, buf.data(), buf.size());
}
std::string formatted_chat(buf.data(), buf.size());
std::string formatted_chat(buf.data(), res);
LOG_VERBOSE("formatted_chat", {{"text", formatted_chat.c_str()}});
return formatted_chat;