-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Don't allow grammar json array to output unescaped new line in string #5885
Conversation
Related to IntrinsicLabsAI/gbnfgen#31 |
Oopsie woopsie, I did a mistake
Won't actually BLOCK \ characters and new lines, it will interpret \\ to block and the letter n (lowercase only) Example :
And giving a try with :
Segfaults (llama_sampling_init: failed to parse grammar) Now, my question is , from original grammar file: |
Hm, not sure - if you find something that works, open a PR. For now I reverted the change |
Thanks for reverting, i'll do more investigations, it could also be caused by my terminal interpreting the anti slashes |
Alright, it seems that my command line interpreter was causing the \ + lower case N interpretation, and even with that, it was not fully fixed because I forgot about carriage return. I'll take some time to see if there are others nasty characters that can cause troubles with json strings |
…nov#5885) * Don't allow grammar json array to output unescaped new line in string * Don't allow new line in json object string
…ggerganov#5885)" This reverts commit b1a4e99.
…nov#5885) * Don't allow grammar json array to output unescaped new line in string * Don't allow new line in json object string
…ggerganov#5885)" This reverts commit b1a4e99.
…nov#5885) * Don't allow grammar json array to output unescaped new line in string * Don't allow new line in json object string
…ggerganov#5885)" This reverts commit b1a4e99.
I had this issue where the generated json was this (with a another grammar file)
For the grammar builder I came up with this solution