fixed grammar not resetting correctly

This commit is contained in:
Concedo 2024-11-23 09:55:12 +08:00
parent 18f227625b
commit 1dd37933e3
2 changed files with 7 additions and 4 deletions

View file

@ -1507,6 +1507,7 @@ static void load_grammar(const std::string & gammarstr)
}
if (!gammarstr.empty()) {
parsed_grammar = llama_grammar_parser();
parsed_grammar.parse(gammarstr.c_str());
// will be empty (default) if there are parse errors
if (parsed_grammar.rules.empty()) {