Fix spacing
This commit is contained in:
parent
50ef6ca3b9
commit
839cf4ccab
1 changed files with 10 additions and 10 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue