Server: Handle n_keep parameter in the request (#6174)

This commit is contained in:
Karthick 2024-03-20 16:32:34 +05:30 committed by GitHub
parent bd60d82d0c
commit 47cc7a7bf9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -371,6 +371,7 @@ static json oaicompat_completion_params_parse(
llama_params["repeat_last_n"] = json_value(body, "repeat_last_n", default_sparams.penalty_last_n);
llama_params["ignore_eos"] = json_value(body, "ignore_eos", false);
llama_params["tfs_z"] = json_value(body, "tfs_z", default_sparams.tfs_z);
llama_params["n_keep"] = json_value(body, "n_keep", 0);
if (body.count("grammar") != 0) {
llama_params["grammar"] = json_value(body, "grammar", json::object());