diff --git a/tools/server/server-task.cpp b/tools/server/server-task.cpp index 4cc87bc5078..e70d673096c 100644 --- a/tools/server/server-task.cpp +++ b/tools/server/server-task.cpp @@ -383,6 +383,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