Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Incorrect Finality Check in RegexGuide.get_next_state() #884

Closed
wants to merge 2 commits into from

Conversation

lapp0
Copy link
Collaborator

@lapp0 lapp0 commented May 10, 2024

Fixes #856

The issue was caused by the fact that in RegexGuide self.final_states includes not just necessarily final states, but all **possibly final states, .

In other words, in main if we get to a state which can legally complete (e.g. 127.0.0.1), the current state will be returned for get_next_state for any non-EOS token. 127.0.0.11 is a legal continuation, but because no state transition occurred, we could continue with 127.0.0.123, 127.0.0.1234, 127.0.0.12345, etc

The correct check to determine whether a state is necessarily final and must produce an EOS next is state not in self.states_to_token_maps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Endless generation bug popped up during migration to Guide in vLLM integration
1 participant