Update examples/simple-chat/simple-chat.cpp

Co-authored-by: Xuan Son Nguyen <thichthat@gmail.com>
This commit is contained in:
Diego Devesa 2024-11-01 23:45:16 +01:00 committed by GitHub
parent afec6106e1
commit 051bf88153
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -178,7 +178,7 @@ int main(int argc, char ** argv) {
// add the response to the messages
messages.push_back({"assistant", strdup(response.c_str())});
prev_len = llama_chat_apply_template(model, nullptr, messages.data(), messages.size(), false, formatted.data(), formatted.size());
prev_len = llama_chat_apply_template(model, nullptr, messages.data(), messages.size(), false, nullptr, 0);
if (prev_len < 0) {
fprintf(stderr, "failed to apply the chat template\n");
return 1;