fix unigram.rs test_sample() (#1244)

87230bb59b/tokenizers/tests/unigram.rs (LL71C1-L71C53)

When running cargo test --release, the above line causes an error.

referring to 87230bb59b/tokenizers/src/models/unigram/lattice.rs (L138)

It seems that lattice::from should only take 3 arguments.
If i had to guess, it should be Lattice::from("ABC", 0, 2);
This change makes cargo test --release pass without error.
This commit is contained in:
Chris Ha
2023-05-11 00:04:34 +09:00
committed by GitHub
parent 87230bb59b
commit 4518b0f7f2

View File

@ -68,7 +68,7 @@ fn test_train_unigram_from_file() {
#[cfg(not(debug_assertions))]
#[test]
fn test_sample() {
let mut lattice = Lattice::from("ABC", 0, 1, 2);
let mut lattice = Lattice::from("ABC", 0, 2);
lattice.insert(0, 1, 1.0, 3); // A
lattice.insert(1, 1, 1.2, 4); // B
lattice.insert(2, 1, 1.5, 5); // C