Struct tokenizers::models::bpe::trainer::BpeTrainerBuilder
source · pub struct BpeTrainerBuilder { /* private fields */ }
Expand description
A BpeTrainerBuilder
can be used to create a BpeTrainer
with a custom
configuration.
Implementations§
source§impl BpeTrainerBuilder
impl BpeTrainerBuilder
sourcepub fn min_frequency(self, frequency: u64) -> Self
pub fn min_frequency(self, frequency: u64) -> Self
Set the expected minimum frequency
sourcepub fn vocab_size(self, size: usize) -> Self
pub fn vocab_size(self, size: usize) -> Self
Set the vocabulary size
sourcepub fn show_progress(self, show: bool) -> Self
pub fn show_progress(self, show: bool) -> Self
Set whether to show progress
sourcepub fn special_tokens(self, tokens: Vec<AddedToken>) -> Self
pub fn special_tokens(self, tokens: Vec<AddedToken>) -> Self
Set the special tokens
sourcepub fn limit_alphabet(self, limit: usize) -> Self
pub fn limit_alphabet(self, limit: usize) -> Self
Set whether to limit the alphabet
sourcepub fn initial_alphabet(self, alphabet: HashSet<char>) -> Self
pub fn initial_alphabet(self, alphabet: HashSet<char>) -> Self
Set the initial alphabet
sourcepub fn continuing_subword_prefix(self, prefix: String) -> Self
pub fn continuing_subword_prefix(self, prefix: String) -> Self
Set the continuing_subword_prefix
sourcepub fn end_of_word_suffix(self, suffix: String) -> Self
pub fn end_of_word_suffix(self, suffix: String) -> Self
Set the end_of_word_suffix
sourcepub fn max_token_length(self, max_token_length: Option<usize>) -> Self
pub fn max_token_length(self, max_token_length: Option<usize>) -> Self
Set max_token_length
sourcepub fn build(self) -> BpeTrainer
pub fn build(self) -> BpeTrainer
Constructs the final BpeTrainer
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BpeTrainerBuilder
impl RefUnwindSafe for BpeTrainerBuilder
impl Send for BpeTrainerBuilder
impl Sync for BpeTrainerBuilder
impl Unpin for BpeTrainerBuilder
impl UnwindSafe for BpeTrainerBuilder
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