-
Notifications
You must be signed in to change notification settings - Fork 11k
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
Bug: Unable to load grammar from json.gbnf
example
#7991
Comments
(I am not a developer) |
Look at the older versions of the json.gnbf file, find the one that ggerganov made, and use that. |
Just ran into this same problem, the older file works, the compiler doesn't seem to like the |
Same problem here *, ?, + are working for repetition but not with curly brackets like {0,5}, {4}, {1,16} or so |
Ok after some quick debugging it seems like to be a problem with the llama-cpp-python library. |
Also tested my grammar file with the llama.cpp CLI file and I works like expected |
Library Issue Reference: abetlen/llama-cpp-python#1547 |
Support for discrete repetition operators was only added about 3 weeks ago in #6640 -- so I'm curious to know where exactly the mismatch is at |
Has this issue been solved? I'd really like to pass my grammar file as an argument to the api request, is there a specific way to format it? |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
What happened?
I have tried to load the
json.gbnf
grammar example but haven't been able to do so. The following code is not working.This throws the following error:
ValueError: from_string: error parsing grammar file: parsed_grammar.rules is empty
I'm not sure if the problem resides in the grammar definition file or in the LlamaGrammar class. The problem shows up when I use the
.from_file
method as well.Name and Version
Ubuntu 22.04
Python 3.11 (Anaconda)
llama_cpp_python 0.2.78
What operating system are you seeing the problem on?
Linux
Relevant log output
The text was updated successfully, but these errors were encountered: