Struct tokenizers::tokenizer::TokenizerBuilder
source · 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_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