]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Revert "grammars : don't allow to output unescaped new line in string (#5885)"
authorGeorgi Gerganov <redacted>
Tue, 5 Mar 2024 13:56:24 +0000 (15:56 +0200)
committerGeorgi Gerganov <redacted>
Tue, 5 Mar 2024 13:56:24 +0000 (15:56 +0200)
This reverts commit b1a4e994fde929300d4aeb1deb8320c59cb6edec.

grammars/json.gbnf
grammars/json_arr.gbnf

index 34e014d55d68575faeaafe9cbca130f4a43ce3f7..a9537cdf9fbe49c79967090eab759973c52f2136 100644 (file)
@@ -15,7 +15,7 @@ array  ::=
 
 string ::=
   "\"" (
-    [^"\\\n] |
+    [^"\\] |
     "\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) # escapes
   )* "\"" ws
 
index fd5740eebc5256ed96800aa5fcaaf5fc4ddaf9ee..ef53e77a0baddc5c1dbdcaf505c3597338a47677 100644 (file)
@@ -24,7 +24,7 @@ array  ::=
 
 string ::=
   "\"" (
-    [^"\\\n] |
+    [^"\\] |
     "\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) # escapes
   )* "\"" ws