Skip to content

Commit

Permalink
Revert "[BREAKING CHANGE] Ignore added_tokens (both special and not) … (
Browse files Browse the repository at this point in the history
#1569)

* Revert "[BREAKING CHANGE] Ignore added_tokens (both special and not) in the decoder (#1513)"

This reverts commit 25aee8b.

* don't remove audit

* deprecate id_to_token

* use simple id to token

* don't break id_to_token since we are deprecating anyways?
  • Loading branch information
ArthurZucker committed Jul 12, 2024
1 parent adcb87e commit 95f78df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tokenizers/src/tokenizer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,8 @@ where
.iter()
.filter_map(|id| {
self.added_vocabulary
.id_to_token(*id, &self.model)
.simple_id_to_token(*id)
.or_else(|| self.model.id_to_token(*id))
.filter(|token| {
!skip_special_tokens || !self.added_vocabulary.is_special_token(token)
})
Expand Down

0 comments on commit 95f78df

Please sign in to comment.