]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
common : avoid logging partial messages (which can contain broken UTF-8 sequences...
authorkallewoof <redacted>
Tue, 29 Jul 2025 15:05:38 +0000 (00:05 +0900)
committerGitHub <redacted>
Tue, 29 Jul 2025 15:05:38 +0000 (17:05 +0200)
* bug-fix: don't attempt to log partial parsed messages to avoid crash due to unfinished UTF-8 sequences

common/chat.cpp

index 114dbfccdbfe78904325f75eeaceb83ef697ccf9..0c777d7a780c684a8f047244efb673a400050e32 100644 (file)
@@ -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<json>({msg}).at(0).dump().c_str());
+    if (!is_partial) {
+        LOG_DBG("Parsed message: %s\n", common_chat_msgs_to_json_oaicompat<json>({msg}).at(0).dump().c_str());
+    }
     return msg;
 }