Skip to content

Commit

Permalink
server: validate "--chat-template" argument
Browse files Browse the repository at this point in the history
  • Loading branch information
ngxson committed Feb 9, 2024
1 parent 7efef47 commit ebe3079
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2300,7 +2300,13 @@ static void server_params_parse(int argc, char **argv, server_params &sparams,
invalid_param = true;
break;
}
sparams.chat_template = argv[i];
std::string value(argv[i]);
if (value != "chatml" && value != "llama2") {
fprintf(stderr, "error: chat template can be \"llama2\" or \"chatml\", but got: %s\n", value.c_str());
invalid_param = true;
break;
}
sparams.chat_template = value;
}
else if (arg == "--override-kv")
{
Expand Down

0 comments on commit ebe3079

Please sign in to comment.