From: kallewoof Date: Tue, 29 Jul 2025 15:05:38 +0000 (+0900) Subject: common : avoid logging partial messages (which can contain broken UTF-8 sequences... X-Git-Tag: upstream/0.0.6073~49 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=1a67fcc30677e96dda76bb1b290788e7d8852b51;p=pkg%2Fggml%2Fsources%2Fllama.cpp common : avoid logging partial messages (which can contain broken UTF-8 sequences) (#14937) * bug-fix: don't attempt to log partial parsed messages to avoid crash due to unfinished UTF-8 sequences --- diff --git a/common/chat.cpp b/common/chat.cpp index 114dbfcc..0c777d7a 100644 --- a/common/chat.cpp +++ b/common/chat.cpp @@ -1944,6 +1944,8 @@ common_chat_msg common_chat_parse(const std::string & input, bool is_partial, co } } auto msg = builder.result(); - LOG_DBG("Parsed message: %s\n", common_chat_msgs_to_json_oaicompat({msg}).at(0).dump().c_str()); + if (!is_partial) { + LOG_DBG("Parsed message: %s\n", common_chat_msgs_to_json_oaicompat({msg}).at(0).dump().c_str()); + } return msg; }