Skip to content

Commit

Permalink
chat-template: tweak --chat-template error message when --jinja is set
Browse files Browse the repository at this point in the history
  • Loading branch information
ochafik committed Sep 28, 2024
1 parent dbda025 commit b10ef04
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions common/arg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1860,9 +1860,9 @@ gpt_params_context gpt_params_parser_init(gpt_params & params, llama_example ex,
[](gpt_params & params, const std::string & value) {
if (!llama_chat_verify_template(value, params.use_jinja)) {
throw std::runtime_error(format(
"error: the supplied chat template is not supported: %s\n"
"note: llama.cpp does not use jinja parser, we only support commonly used templates\n",
value.c_str()
"error: the supplied chat template is not supported: %s%s\n",
value.c_str(),
params.use_jinja ? "" : "\nnote: llama.cpp does not use jinja parser, we only support commonly used templates"
));
}
params.chat_template = value;
Expand All @@ -1887,9 +1887,9 @@ gpt_params_context gpt_params_parser_init(gpt_params & params, llama_example ex,
);
if (!llama_chat_verify_template(chat_template, params.use_jinja)) {
throw std::runtime_error(format(
"error: the supplied chat template is not supported: %s\n"
"note: llama.cpp does not use jinja parser, we only support commonly used templates\n",
chat_template.c_str()
"error: the supplied chat template is not supported: %s%s\n",
value.c_str(),
params.use_jinja ? "" : "\nnote: llama.cpp does not use jinja parser, we only support commonly used templates"
));
}
params.chat_template = chat_template;
Expand Down

0 comments on commit b10ef04

Please sign in to comment.