Skip to content

Commit

Permalink
Merge branch 'add-display' of github.com:huggingface/tokenizers into …
Browse files Browse the repository at this point in the history
…add-display

fix git suggestion

nit

__repr__ should use Debug?

small updates
  • Loading branch information
ArthurZucker committed Jun 6, 2024
2 parents 27576e5 + e48cd3a commit 0d9a452
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bindings/python/src/pre_tokenizers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,15 @@ impl Serialize for PyPreTokenizerWrapper {
#[serde(untagged)]
// #[display(fmt = "")]
pub(crate) enum PyPreTokenizerTypeWrapper {
#[display(fmt = "[{}]", "_0.iter().map(|d| d.as_ref().read().unwrap().to_string()).collect::<Vec<_>>().join(\", \")")]
#[display(fmt = "[{}]", "_0_0.iter()
.map(|d| d.as_ref().read().unwrap().to_string())
.fold(String::new(), |mut acc, s| {
if !acc.is_empty() {
acc.push_str(", ");
}
acc.push_str(&s);
acc
})")]
Sequence(Vec<Arc<RwLock<PyPreTokenizerWrapper>>>),
#[display(fmt ="{}", "_0.as_ref().read().unwrap()")]
Single(Arc<RwLock<PyPreTokenizerWrapper>>),
Expand Down

0 comments on commit 0d9a452

Please sign in to comment.