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

Stop using is_final_state and final_states #885

Open
lapp0 opened this issue May 10, 2024 · 0 comments · May be fixed by lapp0/outlines#34
Open

Stop using is_final_state and final_states #885

lapp0 opened this issue May 10, 2024 · 0 comments · May be fixed by lapp0/outlines#34

Comments

@lapp0
Copy link
Contributor

lapp0 commented May 10, 2024

What behavior of the library made you think about the improvement?

The verbiage is a bit confusing. RegexGuide.is_final_state currently returns both EOS-required AND EOS-accepting states.

This has resulted in a few bugs

The ambiguity has resulted in bugs at nearly every step of development, from the previous FSM class, to the original set of CFG LogitsProcessors, just from my recollection.

How would you like it to behave?

  1. Investigate whether is_termination_accepting_state is necessary anywhere. It probably is necessary to determine whether EOS is legal in some places.
  2. Implement is_halted_state. This is the set of states which must produce EOS
  3. Replace dependencies on is_final_state s.t. they use the appropriate new function, e.g. https://github.com/outlines-dev/outlines/blob/4f8433d8d6633b0780c3a6c27981f9adffbe49f5/outlines/generate/generator.py#L94
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant