pub enum BpeError {
InvalidMergeEntry(String),
InvalidVocabEntry(String),
MissingVocabEntry(String),
}Expand description
Errors that can occur when building a Bpe tokenizer or encoding or
decoding text using it.
Variants§
InvalidMergeEntry(String)
There was an invalid entry in the merge list. This means that either
the entry doesn’t have the expected <token> [SPACE] <token> format
or the <token> is not either a single character or the concatenation
of another pair in the merge list.
InvalidVocabEntry(String)
An entry in the vocab (token string to ID map) is not either a known special token or an entry in the merge list.
MissingVocabEntry(String)
An entry was not found in the vocabulary.
Trait Implementations§
Source§impl Error for BpeError
impl Error for BpeError
1.30.0 · 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 Freeze for BpeError
impl RefUnwindSafe for BpeError
impl Send for BpeError
impl Sync for BpeError
impl Unpin for BpeError
impl UnwindSafe for BpeError
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