From 4fd1242bef6cb2325b4ff1c1a80f3b54b64508a6 Mon Sep 17 00:00:00 2001 From: ExtReMLapin <3909752+ExtReMLapin@users.noreply.github.com> Date: Fri, 5 Sep 2025 01:24:08 +0200 Subject: [PATCH] chat : fixed crash when Hermes 2 had a newline before it (#15639) Co-authored-by: CNE Pierre FICHEPOIL --- common/chat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/chat.cpp b/common/chat.cpp index 823d88deca..e962adfdc2 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*(" "(?:" "||||)?"