Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurZucker committed Nov 10, 2023
1 parent 08b6ff7 commit 2327cd1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tokenizers/src/pre_tokenizers/metaspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ fn skip_legacy_serialization(legacy: &bool) -> bool {
*legacy // Skip serialization if legacy is true
}


impl<'de> Deserialize<'de> for Metaspace {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
Expand Down Expand Up @@ -79,9 +78,10 @@ impl PreTokenizer for Metaspace {

pretokenized.split(|_, mut normalized| {
normalized.replace(' ', &self.str_rep)?;
if self.add_prefix_space{
if self.legacy{normalized.prepend(&self.str_rep);}
else if self.add_prefix_space && first_split{
if self.add_prefix_space {
if self.legacy {
normalized.prepend(&self.str_rep);
} else if self.add_prefix_space && first_split {
normalized.prepend(&self.str_rep);
first_split = false; // Set the flag to false after the first split
}
Expand Down

0 comments on commit 2327cd1

Please sign in to comment.