mirror of
https://github.com/mii443/tokenizers.git
synced 2025-08-31 04:29:21 +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
|
/// Disable truncation
|
||||||
#[pyo3(text_signature = "(self)")]
|
#[pyo3(text_signature = "(self)")]
|
||||||
fn no_truncation(&mut 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
|
/// Get the currently set truncation parameters
|
||||||
|
Reference in New Issue
Block a user