added back "alpaca" template
This commit is contained in:
parent
911e35bb8b
commit
8bafae2f78
1 changed files with 15 additions and 0 deletions
|
@ -19550,6 +19550,21 @@ static int32_t llama_chat_apply_template_internal(
|
||||||
if (add_ass) {
|
if (add_ass) {
|
||||||
ss << "ASSISTANT:";
|
ss << "ASSISTANT:";
|
||||||
}
|
}
|
||||||
|
} else if (tmpl == "alpaca" || (tmpl.find("### Instruction:") != std::string::npos && tmpl.find("<|EOT|>") == std::string::npos)) {
|
||||||
|
// meta-math/MetaMath-7B-V1.0
|
||||||
|
for (auto message : chat) {
|
||||||
|
std::string role(message->role);
|
||||||
|
if (role == "system") {
|
||||||
|
ss << message->content << "\n\n";
|
||||||
|
} else if (role == "user") {
|
||||||
|
ss << "### Instruction:\n" << message->content << "\n\n";
|
||||||
|
} else if (role == "assistant") {
|
||||||
|
ss << "### Response:\n" << message->content << "\n\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (add_ass) {
|
||||||
|
ss << "### Response:\n";
|
||||||
|
}
|
||||||
} else if (tmpl == "deepseek" || (tmpl.find("### Instruction:") != std::string::npos && tmpl.find("<|EOT|>") != std::string::npos)) {
|
} else if (tmpl == "deepseek" || (tmpl.find("### Instruction:") != std::string::npos && tmpl.find("<|EOT|>") != std::string::npos)) {
|
||||||
// deepseek-ai/deepseek-coder-33b-instruct
|
// deepseek-ai/deepseek-coder-33b-instruct
|
||||||
for (auto message : chat) {
|
for (auto message : chat) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue