Skip to content

Commit

Permalink
Update tokenizers/src/models/mod.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Arthur <[email protected]>
  • Loading branch information
Narsil and ArthurZucker authored Aug 6, 2024
1 parent 2b6b054 commit 9ee323d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tokenizers/src/models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,18 @@ impl<'de> Deserialize<'de> for ModelWrapper {

let helper = ModelHelper::deserialize(deserializer)?;
Ok(match helper {
ModelHelper::Tagged(bpe) => match bpe.variant {
ModelHelper::Tagged(model) => match model.variant {
EnumType::BPE => ModelWrapper::BPE(
serde_json::from_value(bpe.rest).map_err(serde::de::Error::custom)?,
serde_json::from_value(model.rest).map_err(serde::de::Error::custom)?,
),
EnumType::WordPiece => ModelWrapper::WordPiece(
serde_json::from_value(bpe.rest).map_err(serde::de::Error::custom)?,
serde_json::from_value(model.rest).map_err(serde::de::Error::custom)?,
),
EnumType::WordLevel => ModelWrapper::WordLevel(
serde_json::from_value(bpe.rest).map_err(serde::de::Error::custom)?,
serde_json::from_value(model.rest).map_err(serde::de::Error::custom)?,
),
EnumType::Unigram => ModelWrapper::Unigram(
serde_json::from_value(bpe.rest).map_err(serde::de::Error::custom)?,
serde_json::from_value(model.rest).map_err(serde::de::Error::custom)?,
),
},
ModelHelper::Legacy(value) => {
Expand Down

0 comments on commit 9ee323d

Please sign in to comment.