浏览代码

Critical fix from llama.cpp JSON grammar to forbid un-escaped escape characters inside strings, which breaks parsing. (#3782)

Craig Hughes 10 月之前
父节点
当前提交
b84aea1685
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      llm/server.go

+ 1 - 1
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