@@ -569,6 +569,7 @@ static void test_template_output_parsers() {
569
569
{
570
570
// Not supported yet
571
571
auto tmpls = read_templates (" models/templates/CohereForAI-c4ai-command-r-plus-tool_use.jinja" );
572
+ assert_equals (COMMON_CHAT_FORMAT_CONTENT_ONLY, common_chat_templates_apply (tmpls.get (), inputs_no_tools).format );
572
573
assert_equals (COMMON_CHAT_FORMAT_GENERIC, common_chat_templates_apply (tmpls.get (), inputs_tools).format );
573
574
}
574
575
{
@@ -665,6 +666,7 @@ static void test_template_output_parsers() {
665
666
auto tmpls = read_templates (" models/templates/NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use.jinja" );
666
667
std::vector<std::string> end_tokens{ " <|im_end|>" };
667
668
669
+ assert_equals (COMMON_CHAT_FORMAT_CONTENT_ONLY, common_chat_templates_apply (tmpls.get (), inputs_no_tools).format );
668
670
assert_equals (COMMON_CHAT_FORMAT_HERMES_2_PRO, common_chat_templates_apply (tmpls.get (), inputs_tools).format );
669
671
assert_equals (
670
672
COMMON_CHAT_FORMAT_HERMES_2_PRO,
@@ -793,6 +795,7 @@ static void test_template_output_parsers() {
793
795
auto tmpls = read_templates (" models/templates/meta-llama-Llama-3.1-8B-Instruct.jinja" );
794
796
std::vector<std::string> end_tokens{ " <|eom_id|>" , " <|eot_id|>" };
795
797
798
+ assert_equals (COMMON_CHAT_FORMAT_CONTENT_ONLY, common_chat_templates_apply (tmpls.get (), inputs_no_tools).format );
796
799
assert_equals (COMMON_CHAT_FORMAT_LLAMA_3_X, common_chat_templates_apply (tmpls.get (), inputs_tools).format );
797
800
assert_equals (COMMON_CHAT_FORMAT_LLAMA_3_X_WITH_BUILTIN_TOOLS,
798
801
common_chat_templates_apply (tmpls.get (), inputs_tools_builtin).format );
@@ -815,6 +818,7 @@ static void test_template_output_parsers() {
815
818
std::vector<std::string> end_tokens{ " <|eom_id|>" , " <|eot_id|>" };
816
819
817
820
assert_equals (COMMON_CHAT_FORMAT_LLAMA_3_X, common_chat_templates_apply (tmpls.get (), inputs_tools).format );
821
+ assert_equals (COMMON_CHAT_FORMAT_CONTENT_ONLY, common_chat_templates_apply (tmpls.get (), inputs_no_tools).format );
818
822
819
823
test_templates (tmpls.get (), end_tokens, message_assist, tools, " Hello, world!\n What's up?" , /* expect_grammar_triggered= */ false );
820
824
test_templates (tmpls.get (), end_tokens, message_assist_call, tools,
@@ -824,6 +828,8 @@ static void test_template_output_parsers() {
824
828
auto tmpls = read_templates (" models/templates/meetkai-functionary-medium-v3.1.jinja" );
825
829
std::vector<std::string> end_tokens{ " <|eom_id|>" , " <|eot_id|>" };
826
830
831
+ assert_equals (COMMON_CHAT_FORMAT_CONTENT_ONLY,
832
+ common_chat_templates_apply (tmpls.get (), inputs_no_tools).format );
827
833
assert_equals (COMMON_CHAT_FORMAT_FUNCTIONARY_V3_1_LLAMA_3_1,
828
834
common_chat_templates_apply (tmpls.get (), inputs_tools).format );
829
835
@@ -851,6 +857,7 @@ static void test_template_output_parsers() {
851
857
auto tmpls = read_templates (" models/templates/fireworks-ai-llama-3-firefunction-v2.jinja" );
852
858
std::vector<std::string> end_tokens{ " <|eot_id|>" };
853
859
860
+ assert_equals (COMMON_CHAT_FORMAT_CONTENT_ONLY, common_chat_templates_apply (tmpls.get (), inputs_no_tools).format );
854
861
assert_equals (COMMON_CHAT_FORMAT_FIREFUNCTION_V2, common_chat_templates_apply (tmpls.get (), inputs_tools).format );
855
862
856
863
test_templates (tmpls.get (), end_tokens, message_assist, tools, " Hello, world!\n What's up?" , /* expect_grammar_triggered= */ false );
@@ -862,6 +869,7 @@ static void test_template_output_parsers() {
862
869
auto tmpls = read_templates (" models/templates/deepseek-ai-DeepSeek-R1-Distill-Llama-8B.jinja" );
863
870
std::vector<std::string> end_tokens{ " <|end▁of▁sentence|>" };
864
871
872
+ assert_equals (COMMON_CHAT_FORMAT_DEEPSEEK_R1, common_chat_templates_apply (tmpls.get (), inputs_no_tools).format );
865
873
assert_equals (COMMON_CHAT_FORMAT_DEEPSEEK_R1, common_chat_templates_apply (tmpls.get (), inputs_tools).format );
866
874
assert_equals (COMMON_CHAT_FORMAT_DEEPSEEK_R1_EXTRACT_REASONING, common_chat_templates_apply (tmpls.get (), inputs_tools_think).format );
867
875
@@ -891,6 +899,7 @@ static void test_template_output_parsers() {
891
899
auto tmpls = read_templates (" models/templates/llama-cpp-deepseek-r1.jinja" );
892
900
std::vector<std::string> end_tokens{ " <|end▁of▁sentence|>" };
893
901
902
+ assert_equals (COMMON_CHAT_FORMAT_DEEPSEEK_R1, common_chat_templates_apply (tmpls.get (), inputs_no_tools).format );
894
903
assert_equals (COMMON_CHAT_FORMAT_DEEPSEEK_R1, common_chat_templates_apply (tmpls.get (), inputs_tools).format );
895
904
assert_equals (COMMON_CHAT_FORMAT_DEEPSEEK_R1_EXTRACT_REASONING, common_chat_templates_apply (tmpls.get (), inputs_tools_think).format );
896
905
0 commit comments