pub struct TokenizerBuilder<M, N, PT, PP, D> { /* private fields */ }Expand description
Builder for Tokenizer structs.
build() fails if the model is missing.
Implementations§
Source§impl<M, N, PT, PP, D> TokenizerBuilder<M, N, PT, PP, D>
impl<M, N, PT, PP, D> TokenizerBuilder<M, N, PT, PP, D>
Sourcepub fn build(self) -> Result<TokenizerImpl<M, N, PT, PP, D>>
pub fn build(self) -> Result<TokenizerImpl<M, N, PT, PP, D>>
Convert the TokenizerBuilder to a Tokenizer.
Conversion fails if the model is missing.
Sourcepub fn with_model(self, model: M) -> Self
pub fn with_model(self, model: M) -> Self
Set the model.
Sourcepub fn with_normalizer(self, normalizer: Option<N>) -> Self
pub fn with_normalizer(self, normalizer: Option<N>) -> Self
Set the normalizer.
Sourcepub fn with_pre_tokenizer(self, pretokenizer: Option<PT>) -> Self
pub fn with_pre_tokenizer(self, pretokenizer: Option<PT>) -> Self
Set the pre-tokenizer.
Sourcepub fn with_post_processor(self, post_processor: Option<PP>) -> Self
pub fn with_post_processor(self, post_processor: Option<PP>) -> Self
Set the post-processor.
Sourcepub fn with_decoder(self, decoder: Option<D>) -> Self
pub fn with_decoder(self, decoder: Option<D>) -> Self
Set the decoder.
Sourcepub fn with_added_vocabulary(self, added_vocabulary: AddedVocabulary) -> Self
pub fn with_added_vocabulary(self, added_vocabulary: AddedVocabulary) -> Self
Set the added vocabulary.
Sourcepub fn with_truncation(self, trunc: Option<TruncationParams>) -> Self
pub fn with_truncation(self, trunc: Option<TruncationParams>) -> Self
Set the trunaction parameters.
Sourcepub fn with_padding(self, padding: Option<PaddingParams>) -> Self
pub fn with_padding(self, padding: Option<PaddingParams>) -> Self
Set the padding parameters.
Trait Implementations§
Source§impl<M, N, PT, PP, D> Default for TokenizerBuilder<M, N, PT, PP, D>
impl<M, N, PT, PP, D> Default for TokenizerBuilder<M, N, PT, PP, D>
Auto Trait Implementations§
impl<M, N, PT, PP, D> Freeze for TokenizerBuilder<M, N, PT, PP, D>
impl<M, N, PT, PP, D> RefUnwindSafe for TokenizerBuilder<M, N, PT, PP, D>
impl<M, N, PT, PP, D> Send for TokenizerBuilder<M, N, PT, PP, D>
impl<M, N, PT, PP, D> Sync for TokenizerBuilder<M, N, PT, PP, D>
impl<M, N, PT, PP, D> Unpin for TokenizerBuilder<M, N, PT, PP, D>
impl<M, N, PT, PP, D> UnwindSafe for TokenizerBuilder<M, N, PT, PP, D>
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