mirror of
https://github.com/mii443/tokenizers.git
synced 2025-08-23 00:35:35 +00:00
Merge pull request #1316 from boyleconnor/add-expect-for-no-truncation
Add `expect()` for disabling truncation
This commit is contained in:
@ -718,7 +718,9 @@ impl PyTokenizer {
|
||||
/// Disable truncation
|
||||
#[pyo3(text_signature = "(self)")]
|
||||
fn no_truncation(&mut self) {
|
||||
let _ = self.tokenizer.with_truncation(None);
|
||||
self.tokenizer
|
||||
.with_truncation(None)
|
||||
.expect("Failed to set truncation to `None`! This should never happen");
|
||||
}
|
||||
|
||||
/// Get the currently set truncation parameters
|
||||
|
Reference in New Issue
Block a user