Skip to content

Commit

Permalink
Add chat frame for Cohere's CommandR
Browse files Browse the repository at this point in the history
  • Loading branch information
zeux committed Apr 19, 2024
1 parent 3a12ad9 commit 312d0de
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ static const char* chatframe(const char* style, bool has_system) {
} else if (strcmp(style, "gemma") == 0) {
return has_system ? "<start_of_turn>user\nSYSTEM: %s\n%s<end_of_turn>\n<start_of_turn>model\n"
: "<start_of_turn>user\n%s<end_of_turn>\n<start_of_turn>model\n";
} else if (strcmp(style, "cohere") == 0) {
return has_system ? "<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>%s<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>%s<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>"
: "<|START_OF_TURN_TOKEN|><|USER_TOKEN|>%s<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>";
} else {
return has_system ? "[INST] <<SYS>>\n%s\n<</SYS>>\n\n%s [/INST]" : "[INST] %s [/INST]";
}
Expand Down

0 comments on commit 312d0de

Please sign in to comment.