Struct tokenizers::models::bpe::BpeBuilder
source · pub struct BpeBuilder { /* private fields */ }
Expand description
A BpeBuilder
can be used to create a BPE
model with a custom configuration.
Implementations§
source§impl BpeBuilder
impl BpeBuilder
sourcepub fn vocab_and_merges(self, vocab: Vocab, merges: Merges) -> Self
pub fn vocab_and_merges(self, vocab: Vocab, merges: Merges) -> Self
Set the vocab (token -> ID) and merges mappings.
sourcepub fn cache_capacity(self, capacity: usize) -> Self
pub fn cache_capacity(self, capacity: usize) -> Self
Set the cache’s capacity. Set to 0 if you want to disable caching.
sourcepub fn continuing_subword_prefix(self, prefix: String) -> Self
pub fn continuing_subword_prefix(self, prefix: String) -> Self
Set the continuing_subword_prefix
option.
sourcepub fn end_of_word_suffix(self, prefix: String) -> Self
pub fn end_of_word_suffix(self, prefix: String) -> Self
Set the end_of_word_suffix
option.
sourcepub fn byte_fallback(self, byte_fallback: bool) -> Self
pub fn byte_fallback(self, byte_fallback: bool) -> Self
Set the byte_fallback
option.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BpeBuilder
impl RefUnwindSafe for BpeBuilder
impl Send for BpeBuilder
impl Sync for BpeBuilder
impl Unpin for BpeBuilder
impl UnwindSafe for BpeBuilder
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