From 4b13839bbd9fcf25ee6bd168de4f3f9622561e83 Mon Sep 17 00:00:00 2001 From: kc611 Date: Mon, 28 Oct 2024 10:58:57 +0530 Subject: [PATCH] Revert changes to test_statistical --- tests/fsm/test_statistical.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fsm/test_statistical.py b/tests/fsm/test_statistical.py index 17d8a026..20ef28cd 100644 --- a/tests/fsm/test_statistical.py +++ b/tests/fsm/test_statistical.py @@ -49,7 +49,7 @@ def generate(model, tokenizer, regex_str) -> Optional[List[int]]: fsm = RegexGuide.from_regex(regex_str, tokenizer) state: int = fsm.initial_state tokens = None - while state is not None: + while state != -1: allowed = fsm.get_next_instruction(state).tokens mask: List[int] = [1 if s in allowed else 0 for s in range(1, n_tokens + 1)] tokens = model(tokens, mask=mask)