From b84aea1685329f107c5547b1cca4efcf15c19f52 Mon Sep 17 00:00:00 2001 From: Craig Hughes Date: Sun, 9 Jun 2024 13:57:09 -0400 Subject: [PATCH] Critical fix from llama.cpp JSON grammar to forbid un-escaped escape characters inside strings, which breaks parsing. (#3782) --- llm/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llm/server.go b/llm/server.go index 6cb01fa0..0a815798 100644 --- a/llm/server.go +++ b/llm/server.go @@ -606,7 +606,7 @@ array ::= string ::= "\"" ( - [^"\\] | + [^"\\\x7F\x00-\x1F] | "\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) # escapes )* "\"" ws