pub struct FastTokenizer { /* private fields */ }Expand description
Hybrid tokenizer: fast BPE encoding via fastokens, decoding via HuggingFace.
Both backends are loaded from the same tokenizer.json file.
Implementations§
Trait Implementations§
Source§impl Decoder for FastTokenizer
impl Decoder for FastTokenizer
fn decode( &self, token_ids: &[TokenIdType], skip_special_tokens: bool, ) -> Result<DecodeResult>
Source§impl Encoder for FastTokenizer
impl Encoder for FastTokenizer
Source§impl Tokenizer for FastTokenizer
impl Tokenizer for FastTokenizer
Source§fn with_options(self, options: TokenizerOptions) -> Selfwhere
Self: Sized,
fn with_options(self, options: TokenizerOptions) -> Selfwhere
Self: Sized,
Apply construction-time
TokenizerOptions. Read moreAuto Trait Implementations§
impl !Freeze for FastTokenizer
impl RefUnwindSafe for FastTokenizer
impl Send for FastTokenizer
impl Sync for FastTokenizer
impl Unpin for FastTokenizer
impl UnsafeUnpin for FastTokenizer
impl UnwindSafe for FastTokenizer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more