Removed adding of BOS token before first message

This commit is contained in:
Wouter Tichelaar 2024-04-19 09:58:21 +02:00
parent 7370d663a3
commit a55d8a9348

View file

@ -17018,13 +17018,8 @@ static int32_t llama_chat_apply_template_internal(
}
} else if (tmpl == "llama3" || (tmpl.find("<|start_header_id|>") != std::string::npos && tmpl.find("<|end_header_id|>") != std::string::npos)) {
// Llama 3
bool first_message = true; // add BOS at the beginning
for (auto message : chat) {
std::string role(message->role);
if (first_message) {
ss << "<|begin_of_text|>";
first_message = false;
}
ss << "<|start_header_id|>" << role << "<|end_header_id|>\n\n" << trim(message->content) << "<|eot_id|>";
}
if (add_ass) {