Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurZucker committed Feb 16, 2025
1 parent 9b9ea69 commit 2ca9329
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tokenizers/src/models/backtracking_bpe/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ impl<'de> Visitor<'de> for BacktrackingBpeVisitor {

#[cfg(test)]
mod test {
use std::process::exit;

use super::*;
use crate::models::bpe::Vocab;
use crate::tokenizer::Tokenizer;
Expand Down Expand Up @@ -154,9 +156,8 @@ mod test {
["a", "b"],
["ab", "a"],
["ab", "b"],
["ab", "bb"],
["b", "b"]
["b", "b"],
["ab", "bb"]
]
}"#;
// [(0, 1), (2, 0), (2, 1), (2, 5), (1, 1), (5, 5), (0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]
Expand All @@ -167,14 +168,14 @@ mod test {
match reconstructed {
Ok(reconstructed) => {
println!("Good. Now doing backtracking:");
// println!("{:?}", reconstructed.encode_via_backtracking(b"aab c d"));
println!("{:?}", reconstructed.encode_via_backtracking(b"aab"));
}
Err(err) => {
println!("Error deserializing: {:?}", err);
}
}
println!("End of my example");

exit(0);
let vocab: Vocab = [
("a".into(), 0),
("b".into(), 1),
Expand Down

0 comments on commit 2ca9329

Please sign in to comment.