-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
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
Grammars bracket repetition symbol not working #1547
Comments
Same here. |
running into this as well on a slightly more complicated gbnf on a line "parse: error parsing grammar: expecting newline or end at object_type_1 | object_type_2" |
This is a snippet of test GBNF that llama_cpp is offering in llama_grammar.py.
In this code, repetition is done by actually repeating (writing down) token as many as we want, which differs from what original JSON GBNF sample does. |
RIght, thanks for your answers. I ended up writing a function to automatically convert the bracket syntax into a set of repeating tokens. Not very elegant, but works well enough. |
Bracket support for grammars was added about 3 weeks ago in ggml-org/llama.cpp#6640 -- is this Python library referencing a version that includes this newest change? |
For some reasons it was reimplemented in python (god knows why) that's why it wasn't auto ported here |
WIP #1637 |
Hello, I tried checking for similar issues about this problem but couldn't find one.
I've had an issue with not being able to use the repetition brackets symbol when working with grammars.
I'm using Ubuntu 20.04, Python 3.12 and
llama_cpp_python==0.2.79
.The following works fine:
But this doesn't:
It returns this error:
The llama.cpp GBNF Guide seems to say it should be possible to use this pattern?
Not sure if my understanding of GBNF is lacking or if it's a real bug.
Thank you!
The text was updated successfully, but these errors were encountered: