grammar : fix max repetition threshold (#28469)

This commit is contained in:
Aldehir Rojas
2026-09-06 11:59:10 +03:00
committed by GitHub
parent 0afb805b19
commit 9e0e220594
+1 -1
View File
@@ -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");
}