Skip to content

Commit f0231a5

Browse files
author
Olivier Chafik
committed
fix common_chat_msg invocations
1 parent d186721 commit f0231a5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

common/common.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,10 +1855,10 @@ std::string common_chat_format_single(
18551855

18561856
std::string common_chat_format_example(const common_chat_template & tmpl, bool use_jinja) {
18571857
std::vector<common_chat_msg> msgs = {
1858-
{"system", "You are a helpful assistant"},
1859-
{"user", "Hello"},
1860-
{"assistant", "Hi there"},
1861-
{"user", "How are you?"},
1858+
{"system", "You are a helpful assistant", {}},
1859+
{"user", "Hello", {}},
1860+
{"assistant", "Hi there", {}},
1861+
{"user", "How are you?", {}},
18621862
};
18631863
return common_chat_apply_template(tmpl, msgs, true, use_jinja);
18641864
}

tests/test-chat-template.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ int main(void) {
328328
// test llama_chat_format_single for system message
329329
printf("\n\n=== llama_chat_format_single (system message) ===\n\n");
330330
std::vector<common_chat_msg> chat2;
331-
common_chat_msg sys_msg{"system", "You are a helpful assistant"};
331+
common_chat_msg sys_msg{"system", "You are a helpful assistant", {}};
332332

333333
auto fmt_sys = [&](std::string tmpl_str) {
334334
minja::chat_template tmpl(tmpl_str, "", "");
@@ -352,10 +352,10 @@ int main(void) {
352352

353353
// test llama_chat_format_single for user message
354354
printf("\n\n=== llama_chat_format_single (user message) ===\n\n");
355-
chat2.push_back({"system", "You are a helpful assistant"});
356-
chat2.push_back({"user", "Hello"});
357-
chat2.push_back({"assistant", "I am assistant"});
358-
common_chat_msg new_msg{"user", "How are you"};
355+
chat2.push_back({"system", "You are a helpful assistant", {}});
356+
chat2.push_back({"user", "Hello", {}});
357+
chat2.push_back({"assistant", "I am assistant", {}});
358+
common_chat_msg new_msg{"user", "How are you", {}};
359359

360360
auto fmt_single = [&](std::string tmpl_str) {
361361
minja::chat_template tmpl(tmpl_str, "", "");

0 commit comments

Comments
 (0)