From 9e0e220594af405a62835dc3a27495729fd8506b Mon Sep 17 00:00:00 2001 From: Aldehir Rojas Date: Sun, 6 Sep 2026 03:59:10 -0500 Subject: [PATCH] grammar : fix max repetition threshold (#28469) --- src/llama-grammar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llama-grammar.cpp b/src/llama-grammar.cpp index f14215ac7..6aa03c766 100644 --- a/src/llama-grammar.cpp +++ b/src/llama-grammar.cpp @@ -492,7 +492,7 @@ const char * llama_grammar_parser::parse_sequence( total_rules = min_times; } - if (n_prev_rules * total_rules >= MAX_REPETITION_THRESHOLD) { + if (n_prev_rules * total_rules > MAX_REPETITION_THRESHOLD) { throw std::runtime_error("number of rules that are going to be repeated multiplied by the new repetition exceeds sane defaults, please reduce the number of repetitions or rule complexity"); }