We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I just use the grammar from https://github.com/ggerganov/llama.cpp/blob/master/grammars/README.md
using xgramar==0.1.7, reproduce code
import xgrammar as xgr grammar_str = """ char ::= [^"\\\x7F\x00-\x1F] | [\\] (["\\bfnrt] | "u" [0-9a-fA-F]{4}) item ::= "{" space item-name-kv "," space item-age-kv "}" space item-age ::= ([0-9] | ([1-8] [0-9] | [9] [0-9]) | "1" ([0-4] [0-9] | [5] "0")) space item-age-kv ::= "\"age\"" space ":" space item-age item-name ::= "\"" char{1,100} "\"" space item-name-kv ::= "\"name\"" space ":" space item-name root ::= "[" space item ("," space item){9,99} "]" space space ::= | " " | "\n" [ \t]{0,20} """ print(xgr.Grammar.from_ebnf(grammar_str))
got RuntimeError: [07:57:35] /workspace/cpp/grammar_parser.cc:72: EBNF parse error at line 2, column 13: Invalid escape sequence
The text was updated successfully, but these errors were encountered:
Thanks for the catch @TopIdiot. The issue here is the repetition {l, r} is not supported well by xgrammar. We are working to fix this issue.
{l, r}
Sorry, something went wrong.
No branches or pull requests
I just use the grammar from https://github.com/ggerganov/llama.cpp/blob/master/grammars/README.md
using xgramar==0.1.7, reproduce code
got
RuntimeError: [07:57:35] /workspace/cpp/grammar_parser.cc:72: EBNF parse error at line 2, column 13: Invalid escape sequence
The text was updated successfully, but these errors were encountered: