summaryrefslogtreecommitdiff
path: root/llama.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llama.cpp')
-rw-r--r--llama.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llama.cpp b/llama.cpp
index 9cae8c76..055b57e3 100644
--- a/llama.cpp
+++ b/llama.cpp
@@ -12773,6 +12773,15 @@ static int32_t llama_chat_apply_template_internal(
if (add_ass) {
ss << "<|assistant|>\n";
}
+ } else if (tmpl.find("bos_token + message['role']") != std::string::npos) {
+ // mlabonne/AlphaMonarch-7B template (the <s> is included inside history)
+ for (auto message : chat) {
+ std::string bos = (message == chat.front()) ? "" : "<s>"; // skip BOS for first message
+ ss << bos << message->role << "\n" << message->content << "</s>\n";
+ }
+ if (add_ass) {
+ ss << "<s>assistant\n";
+ }
} else {
// template not supported
return -1;