Skip to content

Commit 4fd1242

Browse files
ExtReMLapinCNE Pierre FICHEPOIL
andauthored
chat : fixed crash when Hermes 2 <tool_call> had a newline before it (#15639)
Co-authored-by: CNE Pierre FICHEPOIL <pierre-1.fichepoil@gendarmerie.interieur.gouv.fr>
1 parent b2426e4 commit 4fd1242

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/chat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1892,7 +1892,7 @@ static common_chat_params common_chat_params_init_hermes_2_pro(const common_chat
18921892
// If thinking_forced_open, then we capture the </think> tag in the grammar,
18931893
// (important for required tool choice) and in the trigger's first capture (decides what is sent to the grammar)
18941894
std::string(data.thinking_forced_open ? "[\\s\\S]*?(</think>\\s*)" : "(?:<think>[\\s\\S]*?</think>\\s*)?") + (
1895-
"(\\s*"
1895+
"\\s*("
18961896
"(?:<tool_call>"
18971897
"|<function"
18981898
"|(?:```(?:json|xml)?\n\\s*)?(?:<function_call>|<tools>|<xml><json>|<response>)?"

0 commit comments

Comments
 (0)