mistral-7b-reverse-instruct / inst_format.gbnf
Philipp-Sc's picture
Upload inst_format.gbnf
3665e66
raw
history blame
No virus
518 Bytes
# GBNF grammar for [INST] format
root ::= "[INST]\n### System:\n" ws system "\n### Instruction:\n" ws instruction "\n[/INST]\n"
# `system` represents the system information
system ::= string
# `instruction` represents the instruction information
instruction ::= string
string ::=
"\"" (
[^"\\] |
"\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) # escapes
)* "\"" ws
# Optional space: by convention, applied in this grammar after literal chars when allowed
ws ::= ([ \t\n] ws)?