From: ExtReMLapin Date: Thu, 4 Sep 2025 23:24:08 +0000 (+0200) Subject: chat : fixed crash when Hermes 2 had a newline before it (#15639) X-Git-Tag: upstream/0.0.6527~140 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=4fd1242bef6cb2325b4ff1c1a80f3b54b64508a6;p=pkg%2Fggml%2Fsources%2Fllama.cpp chat : fixed crash when Hermes 2 had a newline before it (#15639) Co-authored-by: CNE Pierre FICHEPOIL --- diff --git a/common/chat.cpp b/common/chat.cpp index 823d88de..e962adfd 100644 --- a/common/chat.cpp +++ b/common/chat.cpp @@ -1892,7 +1892,7 @@ static common_chat_params common_chat_params_init_hermes_2_pro(const common_chat // If thinking_forced_open, then we capture the tag in the grammar, // (important for required tool choice) and in the trigger's first capture (decides what is sent to the grammar) std::string(data.thinking_forced_open ? "[\\s\\S]*?(\\s*)" : "(?:[\\s\\S]*?\\s*)?") + ( - "(\\s*" + "\\s*(" "(?:" "||||)?"