File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -21714,16 +21714,16 @@ static int32_t llama_chat_apply_template_internal(
2171421714 }
2171521715 }
2171621716 } else if (tmpl == "granite" || tmpl_contains("<|start_of_role|>")) {
21717- // IBM Granite template
21718- for (const auto & message : chat) {
21719- std::string role(message-> role);
21720- ss << "<|start_of_role|>" << role << "<|end_of_role|>"
21721- << message-> content << "<|end_of_text|>\n";
21722- }
21723- if (add_ass) {
21724- ss << "<|start_of_role|>assistant<|end_of_role|>\n";
21725- }
21726- } else {
21717+ // IBM Granite template
21718+ for (const auto & message: chat) {
21719+ std::string role(message -> role);
21720+ ss << "<|start_of_role|>" << role << "<|end_of_role|>"
21721+ << message -> content << "<|end_of_text|>\n";
21722+ }
21723+ if (add_ass) {
21724+ ss << "<|start_of_role|>assistant<|end_of_role|>\n";
21725+ }
21726+ } else {
2172721727 // template not supported
2172821728 return -1;
2172921729 }
You can’t perform that action at this time.
0 commit comments