Match openchat template with jinja output
This commit is contained in:
parent
1eebfc9f0f
commit
cfcbc7adf3
2 changed files with 5 additions and 8 deletions
11
llama.cpp
11
llama.cpp
|
@ -15701,14 +15701,11 @@ static int32_t llama_chat_apply_template_internal(
|
||||||
// openchat/openchat-3.5-0106,
|
// openchat/openchat-3.5-0106,
|
||||||
for (auto message : chat) {
|
for (auto message : chat) {
|
||||||
std::string role(message->role);
|
std::string role(message->role);
|
||||||
if (role == "user") {
|
if (message == chat.front()) {
|
||||||
ss << "GPT4 Correct User: ";
|
ss << "<s>";
|
||||||
} else if (role == "assistant") {
|
|
||||||
ss << "GPT4 Correct Assistant: ";
|
|
||||||
}
|
}
|
||||||
// Not documented, but apparently the system message is prepended without prefix:
|
role[0] = toupper(role[0]);
|
||||||
// https://huggingface.co/openchat/openchat_3.5/discussions/5#65448109b4a3f3a2f486fd9d
|
ss << "GPT4 Correct " << role << ": " << message->content << "<|end_of_turn|>";
|
||||||
ss << message->content << "<|end_of_turn|>";
|
|
||||||
}
|
}
|
||||||
if (add_ass) {
|
if (add_ass) {
|
||||||
ss << "GPT4 Correct Assistant:";
|
ss << "GPT4 Correct Assistant:";
|
||||||
|
|
|
@ -60,7 +60,7 @@ int main(void) {
|
||||||
// OrionStarAI/Orion-14B-Chat
|
// OrionStarAI/Orion-14B-Chat
|
||||||
"Human: You are a helpful assistant\n\nHello\n\nAssistant: </s>Hi there</s>Human: Who are you\n\nAssistant: </s> I am an assistant </s>Human: Another question\n\nAssistant: </s>",
|
"Human: You are a helpful assistant\n\nHello\n\nAssistant: </s>Hi there</s>Human: Who are you\n\nAssistant: </s> I am an assistant </s>Human: Another question\n\nAssistant: </s>",
|
||||||
// openchat/openchat-3.5-0106
|
// openchat/openchat-3.5-0106
|
||||||
"You are a helpful assistant<|end_of_turn|>GPT4 Correct User: Hello<|end_of_turn|>GPT4 Correct Assistant: Hi there<|end_of_turn|>GPT4 Correct User: Who are you<|end_of_turn|>GPT4 Correct Assistant: I am an assistant <|end_of_turn|>GPT4 Correct User: Another question<|end_of_turn|>GPT4 Correct Assistant:",
|
"<s>GPT4 Correct System: You are a helpful assistant<|end_of_turn|>GPT4 Correct User: Hello<|end_of_turn|>GPT4 Correct Assistant: Hi there<|end_of_turn|>GPT4 Correct User: Who are you<|end_of_turn|>GPT4 Correct Assistant: I am an assistant <|end_of_turn|>GPT4 Correct User: Another question<|end_of_turn|>GPT4 Correct Assistant:",
|
||||||
// eachadea/vicuna-13b-1.1
|
// eachadea/vicuna-13b-1.1
|
||||||
"You are a helpful assistant\n\nUSER: Hello\nASSISTANT: Hi there</s>\nUSER: Who are you\nASSISTANT: I am an assistant </s>\nUSER: Another question\nASSISTANT:",
|
"You are a helpful assistant\n\nUSER: Hello\nASSISTANT: Hi there</s>\nUSER: Who are you\nASSISTANT: I am an assistant </s>\nUSER: Another question\nASSISTANT:",
|
||||||
// Orca-Vicuna
|
// Orca-Vicuna
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue