Skip to content

Commit

Permalink
Added EOS condition to next_state in Index struct
Browse files Browse the repository at this point in the history
  • Loading branch information
kc611 committed Oct 28, 2024
1 parent 4b13839 commit 4d487ee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ impl Index {
}

pub(crate) fn next_state(&self, state: u32, token_id: u32) -> Option<u32> {
if token_id == self.eos_token_id {
return None;
}
Some(*self.states_to_token_subsets.get(&state)?.get(&token_id)?)
}

Expand Down

0 comments on commit 4d487ee

Please sign in to comment.