Fix spacing

This commit is contained in:
arch-btw 2024-10-28 04:32:20 -07:00 committed by GitHub
parent 50ef6ca3b9
commit 839cf4ccab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21714,16 +21714,16 @@ static int32_t llama_chat_apply_template_internal(
}
}
} else if (tmpl == "granite" || tmpl_contains("<|start_of_role|>")) {
// IBM Granite template
for (const auto & message : chat) {
std::string role(message->role);
ss << "<|start_of_role|>" << role << "<|end_of_role|>"
<< message->content << "<|end_of_text|>\n";
}
if (add_ass) {
ss << "<|start_of_role|>assistant<|end_of_role|>\n";
}
} else {
// IBM Granite template
for (const auto & message: chat) {
std::string role(message -> role);
ss << "<|start_of_role|>" << role << "<|end_of_role|>"
<< message -> content << "<|end_of_text|>\n";
}
if (add_ass) {
ss << "<|start_of_role|>assistant<|end_of_role|>\n";
}
} else {
// template not supported
return -1;
}