Skip to content

Commit 438ce0b

Browse files
author
ochafik
committed
fix test-chat
1 parent 1f5ec59 commit 438ce0b

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

common/chat.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ static common_chat_msg parse_json_tool_calls(
140140
LOG_WRN("Content found with tool calls: %s", result.content.c_str());
141141
}
142142
result.content = "";
143-
result.role = "user";
144143
}
145144
return result;
146145
}

tests/test-chat.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -465,18 +465,18 @@ static void test_template_output_parsers() {
465465
" ]\n"
466466
"}");
467467
}
468-
// {
469-
// const common_chat_template tmpl(read_file("models/templates/mistralai-Mistral-Nemo-Instruct-2407.jinja"), "<s>",
470-
// "</s>");
471-
// std::vector<std::string> end_tokens{ "</s>" };
472-
473-
// assert_equals(COMMON_CHAT_FORMAT_MISTRAL_NEMO, common_chat_params_init(tmpl, inputs_tools).format);
474-
475-
// test_template(tmpl, end_tokens, text_message, tools, "Hello, world!", /* expect_grammar_triggered= */ false);
476-
// test_template(
477-
// tmpl, end_tokens, tool_call_message_with_id, tools,
478-
// "[TOOL_CALLS][{\"name\": \"special_function\", \"arguments\": {\"arg1\": 1}, \"id\": \"123456789\"}]");
479-
// }
468+
{
469+
const common_chat_template tmpl(read_file("models/templates/mistralai-Mistral-Nemo-Instruct-2407.jinja"), "<s>",
470+
"</s>");
471+
std::vector<std::string> end_tokens{ "</s>" };
472+
473+
assert_equals(COMMON_CHAT_FORMAT_MISTRAL_NEMO, common_chat_params_init(tmpl, inputs_tools).format);
474+
475+
test_template(tmpl, end_tokens, text_message, tools, "Hello, world!", /* expect_grammar_triggered= */ false);
476+
test_template(
477+
tmpl, end_tokens, tool_call_message_with_id, tools,
478+
"[TOOL_CALLS][{\"name\": \"special_function\", \"arguments\": {\"arg1\": 1}, \"id\": \"123456789\"}]");
479+
}
480480
{
481481
const common_chat_template tmpl(
482482
read_file("models/templates/NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use.jinja"), "<s>", "</s>");

0 commit comments

Comments
 (0)