mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-25 02:44:36 +00:00
tests : fix printfs (#8068)
This commit is contained in:
parent
ed67bcb24f
commit
88954f7fbd
@ -146,7 +146,7 @@ int main(void) {
|
|||||||
auto fmt_sys = [&](std::string tmpl) {
|
auto fmt_sys = [&](std::string tmpl) {
|
||||||
auto output = llama_chat_format_single(nullptr, tmpl, chat2, sys_msg, false);
|
auto output = llama_chat_format_single(nullptr, tmpl, chat2, sys_msg, false);
|
||||||
printf("fmt_sys(%s) : %s\n", tmpl.c_str(), output.c_str());
|
printf("fmt_sys(%s) : %s\n", tmpl.c_str(), output.c_str());
|
||||||
printf("-------------------------\n", output.c_str());
|
printf("-------------------------\n");
|
||||||
return output;
|
return output;
|
||||||
};
|
};
|
||||||
assert(fmt_sys("chatml") == "<|im_start|>system\nYou are a helpful assistant<|im_end|>\n");
|
assert(fmt_sys("chatml") == "<|im_start|>system\nYou are a helpful assistant<|im_end|>\n");
|
||||||
@ -165,7 +165,7 @@ int main(void) {
|
|||||||
auto fmt_single = [&](std::string tmpl) {
|
auto fmt_single = [&](std::string tmpl) {
|
||||||
auto output = llama_chat_format_single(nullptr, tmpl, chat2, new_msg, true);
|
auto output = llama_chat_format_single(nullptr, tmpl, chat2, new_msg, true);
|
||||||
printf("fmt_single(%s) : %s\n", tmpl.c_str(), output.c_str());
|
printf("fmt_single(%s) : %s\n", tmpl.c_str(), output.c_str());
|
||||||
printf("-------------------------\n", output.c_str());
|
printf("-------------------------\n");
|
||||||
return output;
|
return output;
|
||||||
};
|
};
|
||||||
assert(fmt_single("chatml") == "\n<|im_start|>user\nHow are you<|im_end|>\n<|im_start|>assistant\n");
|
assert(fmt_single("chatml") == "\n<|im_start|>user\nHow are you<|im_end|>\n<|im_start|>assistant\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user