Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurZucker committed Jun 10, 2024
1 parent 9c45e8f commit 4a34870
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tokenizers/src/decoders/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use derive_more::Display;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Clone, Debug, Display)]
#[display(fmt="decoders.{})]
#[display(fmt="decoders.{}")]
#[serde(untagged)]
pub enum DecoderWrapper {
BPE(BPEDecoder),
Expand Down
10 changes: 8 additions & 2 deletions tokenizers/src/models/wordpiece/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,14 @@ impl WordPieceBuilder {
/// model.
#[derive(Clone, PartialEq, Eq, Display)]
#[display(
fmt = "vocab={:?}, unk_token={}, continuing_subword_prefix={:?}",
vocab,
fmt = "vocab={}, unk_token={}, continuing_subword_prefix={:?}",
"vocab.iter().take(5).fold(String::new(), |mut acc, (key, value)| {
if !acc.is_empty() {
acc.push_str(\", \");
}
acc.push_str(&format!(\"\'{}\': {}\", key, value));
acc
})",
unk_token,
continuing_subword_prefix
)]
Expand Down

0 comments on commit 4a34870

Please sign in to comment.