pub struct SimpleBPETokenizerConfig { /* private fields */ }Expand description
Configuration for training a simple BPE tokenizer.
This struct implements Trainable and produces a SimpleBPETokenizer.
Implementations§
Source§impl SimpleBPETokenizerConfig
impl SimpleBPETokenizerConfig
Sourcepub fn build(vocab_size: u32) -> Result<Self, VocabSizeTooSmall>
pub fn build(vocab_size: u32) -> Result<Self, VocabSizeTooSmall>
Create a new configuration for training a simple BPE tokenizer from vocab size.
Sourcepub fn from_merges(merges: u32) -> Self
pub fn from_merges(merges: u32) -> Self
Create a new configuration for training a simple BPE tokenizer from number of merges.
Trait Implementations§
Source§impl Debug for SimpleBPETokenizerConfig
impl Debug for SimpleBPETokenizerConfig
Source§impl Trainable for SimpleBPETokenizerConfig
impl Trainable for SimpleBPETokenizerConfig
Source§type Output = SimpleBPETokenizer
type Output = SimpleBPETokenizer
The tokenizer type produced by training.
Source§type TrainingError = Infallible
type TrainingError = Infallible
Error that could happen during training.
Source§fn train(&self, dataset: &str) -> Result<SimpleBPETokenizer, Infallible>
fn train(&self, dataset: &str) -> Result<SimpleBPETokenizer, Infallible>
Trains a tokenizer on a given dataset to a target vocabulary size. Read more
Auto Trait Implementations§
impl Freeze for SimpleBPETokenizerConfig
impl RefUnwindSafe for SimpleBPETokenizerConfig
impl Send for SimpleBPETokenizerConfig
impl Sync for SimpleBPETokenizerConfig
impl Unpin for SimpleBPETokenizerConfig
impl UnwindSafe for SimpleBPETokenizerConfig
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> 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