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
+2
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