-
Notifications
You must be signed in to change notification settings - Fork 1.1k
ValueError: from_string: error parsing grammar file: parsed_grammar.rules is empty #615
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
Comments
Oh I see. That's not a bug. Just put So, the correct version of your schema should be: schema = r'''
space ::= " "?
string ::= "\"" (
[^"\\] |
"\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F])
)* "\"" space
Stage ::= "\"first\"" | "\"second\""
boolean ::= ("true" | "false") space
root ::= "{" space "\"Assistant\"" space ":" space string "," space "\"Stage\"" space ":" space Stage "," space "\"Statement\"" space ":" space string "," space "\"Task Finished\"" space ":" space boolean "}" space
''' |
An issue that doesn't seem to be impacting the functionality, but my grammar doesn't get redisplayed in the output logs:
Otherwise, this feature works great. Any idea when it will be released so I can pip install via pypi? |
The printing error should be resolved with this: |
Thankyou @c0sogi , its working fine now |
...there was no check. ported upstream from zanussbaum/gpt4all.cpp#2 (I dont see any clean path for upstream patches)
Discussed in #614
Originally posted by talhalatifkhan August 16, 2023
I am trying to make sure that my output follow a json format every time, i stumbled upon jsonformer and from there i stumbled upon grammar-based sampling, I used json-schema-to-grammar.py to convert json schema.
I want to know if grammar based sampling is used for this specific purpose and if so then how do i use it.
Json schema
Llama grammar
Here is my code
This is the error i am getting
The text was updated successfully, but these errors were encountered: