Open runarheggset opened 6 months ago
@heggiz in the meantime this works for me
with open('grammars/' + grammar_file, 'r') as file:
grammar_text = file.read()
grammar = LlamaGrammar.from_string(grammar_text)
emojis.gbnf
root ::= emoji+
emoji ::= [\U0001F600 - \U0001F64F]
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Expected Behavior
When using emojis in grammar, I expect the grammar to work the same way as in
llama.cpp
. Here's an example of grammar that works inllama.cpp
, but notllama-cpp-python
:Current Behavior
llama-cpp-python
is unable to parse the emojis and instead crashes.Environment and Context
Failure Information (for bugs)
This issue seems to be the same as https://github.com/ggerganov/llama.cpp/issues/2501
Steps to Reproduce
Here's a short Python snippet that reproduces the issue:
Failure Logs