#[non_exhaustive]pub enum TokenizerError {
UnknownToken(String),
Io(Error),
MalformedFile(String),
}Expand description
Errors that can occur while tokenizing text or loading a tokenizer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
UnknownToken(String)
A sub-word produced during tokenization is not present in the
vocabulary, and no <unk> / [UNK] fallback id was configured.
Io(Error)
An I/O error while loading a vocabulary or merge file (std builds only).
MalformedFile(String)
A line in a vocabulary or merge file could not be parsed.
Trait Implementations§
Source§impl Debug for TokenizerError
impl Debug for TokenizerError
Source§impl Display for TokenizerError
impl Display for TokenizerError
Source§impl Error for TokenizerError
impl Error for TokenizerError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for TokenizerError
impl !UnwindSafe for TokenizerError
impl Freeze for TokenizerError
impl Send for TokenizerError
impl Sync for TokenizerError
impl Unpin for TokenizerError
impl UnsafeUnpin for TokenizerError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more