Philipp-Sc commited on
Commit
3665e66
1 Parent(s): 05aa199

Upload inst_format.gbnf

Browse files
Files changed (1) hide show
  1. inst_format.gbnf +18 -0
inst_format.gbnf ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GBNF grammar for [INST] format
2
+ root ::= "[INST]\n### System:\n" ws system "\n### Instruction:\n" ws instruction "\n[/INST]\n"
3
+
4
+ # `system` represents the system information
5
+ system ::= string
6
+
7
+ # `instruction` represents the instruction information
8
+ instruction ::= string
9
+
10
+ string ::=
11
+ "\"" (
12
+ [^"\\] |
13
+ "\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) # escapes
14
+ )* "\"" ws
15
+
16
+
17
+ # Optional space: by convention, applied in this grammar after literal chars when allowed
18
+ ws ::= ([ \t\n] ws)?