server : fix grammar commandline args (#21543)

Co-authored-by: AUTOMATIC <->
This commit is contained in:
AUTOMATIC1111 2026-04-09 10:16:54 +03:00 committed by GitHub
parent 75511a8d7e
commit 3ee9da0e4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -384,6 +384,8 @@ task_params server_task::params_from_json_cmpl(
throw std::runtime_error(std::string("\"json_schema\": ") + e.what());
}
} else {
params.sampling.grammar = defaults.sampling.grammar;
std::string grammar_str = json_value(data, "grammar", std::string());
if (!grammar_str.empty()) {
// grammar_type key is set by the server when converting chat template grammars