Skip to content

Commit

Permalink
Revert changes to test_statistical
Browse files Browse the repository at this point in the history
  • Loading branch information
kc611 committed Oct 28, 2024
1 parent 6f3a798 commit 4b13839
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/fsm/test_statistical.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4b13839

Please sign in to comment.