diff --git a/common/common.h b/common/common.h index c32d4d067..6c1809277 100644 --- a/common/common.h +++ b/common/common.h @@ -160,7 +160,7 @@ struct common_params_sampling { }; std::string grammar; // optional BNF-like grammar to constrain sampling - bool grammar_lazy; + bool grammar_lazy = false; std::vector grammar_trigger_words; // optional trigger words to trigger lazy grammar std::vector grammar_trigger_tokens; // optional trigger tokens to trigger lazy grammar and print trigger special tokens. diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 754710c68..98f17683f 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -117,7 +117,7 @@ struct slot_params { oaicompat_type oaicompat = OAICOMPAT_TYPE_NONE; std::string oaicompat_model; std::string oaicompat_cmpl_id; - common_chat_format oaicompat_chat_format; + common_chat_format oaicompat_chat_format = COMMON_CHAT_FORMAT_CONTENT_ONLY; json to_json() const { std::vector samplers; @@ -345,10 +345,10 @@ struct server_task { auto it = data.find("chat_format"); if (it != data.end()) { params.oaicompat_chat_format = static_cast(it->get()); + LOG_DBG("Chat format: %s\n", common_chat_format_name(params.oaicompat_chat_format).c_str()); } else { params.oaicompat_chat_format = defaults.oaicompat_chat_format; } - LOG_DBG("Chat format: %s\n", common_chat_format_name(params.oaicompat_chat_format).c_str()); } {