File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 1- # https://github.com/ggerganov/llama.cpp/blob/8183159cf3def112f6d1fe94815fce70e1bffa12/grammars/json.gbnf
2-
31root ::= object
42value ::= object | array | string | number | ("true" | "false" | "null") ws
53
@@ -17,11 +15,11 @@ array ::=
1715
1816string ::=
1917 "\"" (
20- [^"\\] |
21- "\\" (["\\/ bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] ) # escapes
18+ [^"\\\x7F\x00-\x1F ] |
19+ "\\" (["\\bfnrt] | "u" [0-9a-fA-F]{4} ) # escapes
2220 )* "\"" ws
2321
24- number ::= ("-"? ([0-9] | [1-9] [0-9]* )) ("." [0-9]+)? ([eE] [-+]? [0-9]+ )? ws
22+ number ::= ("-"? ([0-9] | [1-9] [0-9]{0,15} )) ("." [0-9]+)? ([eE] [-+]? [0-9] [1-9]{0,15} )? ws
2523
2624# Optional space: by convention, applied in this grammar after literal chars when allowed
27- ws ::= ( [ \t\n] ws)?
25+ ws ::= | " " | "\n" [ \t]{0,20}
You can’t perform that action at this time.
0 commit comments