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

🚨 breaking: Fix training with special tokens #1617

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tokenizers/src/tokenizer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@
N: Normalizer,
{
/// Normalization logic, go through all normalizers
fn do_normalize<V: Into<NormalizedString>>(&self, normalized: V) -> Result<NormalizedString> {

Check warning on line 935 in tokenizers/src/tokenizer/mod.rs

View workflow job for this annotation

GitHub Actions / Check it builds for Windows 32-bit (3.8)

method `do_normalize` is never used

Check warning on line 935 in tokenizers/src/tokenizer/mod.rs

View workflow job for this annotation

GitHub Actions / Check it builds for Windows 32-bit (3.10)

method `do_normalize` is never used

Check warning on line 935 in tokenizers/src/tokenizer/mod.rs

View workflow job for this annotation

GitHub Actions / Check it builds for Windows 32-bit (3.9)

method `do_normalize` is never used

Check warning on line 935 in tokenizers/src/tokenizer/mod.rs

View workflow job for this annotation

GitHub Actions / Check it builds for Windows 32-bit (3.7)

method `do_normalize` is never used

Check warning on line 935 in tokenizers/src/tokenizer/mod.rs

View workflow job for this annotation

GitHub Actions / Check everything builds

method `do_normalize` is never used

Check warning on line 935 in tokenizers/src/tokenizer/mod.rs

View workflow job for this annotation

GitHub Actions / Check everything builds & tests (macos-latest)

method `do_normalize` is never used

Check warning on line 935 in tokenizers/src/tokenizer/mod.rs

View workflow job for this annotation

GitHub Actions / Check everything builds & tests (ubuntu-latest)

method `do_normalize` is never used
let mut normalized: NormalizedString = normalized.into();

if let Some(ref normalizer) = self.normalizer {
Expand Down Expand Up @@ -1188,7 +1188,9 @@
s
}),
|seq| {
let normalized = self.do_normalize(seq.as_ref())?;
let normalized = self
.added_vocabulary
.extract_and_normalize(self.normalizer.as_ref(), seq.as_ref());
let pre_tokenized = self.do_pre_tokenize(normalized)?;
Ok(pre_tokenized
.get_splits(OffsetReferential::Original, OffsetType::Byte)
Expand Down Expand Up @@ -1240,7 +1242,9 @@
s
}),
|seq| {
let normalized = self.do_normalize(seq.as_ref())?;
let normalized = self
.added_vocabulary
.extract_and_normalize(self.normalizer.as_ref(), seq.as_ref());
let pre_tokenized = self.do_pre_tokenize(normalized)?;
Ok(pre_tokenized
.get_splits(OffsetReferential::Original, OffsetType::Byte)
Expand Down
Loading