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
Open

Stop using is_final_state and final_states #885

lapp0 opened this issue May 10, 2024 · 0 comments

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.
    is_finished = is_generation_finished(fsms, fsm_states)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant