Enum tokenizers::models::TrainerWrapper
source · pub enum TrainerWrapper {
BpeTrainer(BpeTrainer),
WordPieceTrainer(WordPieceTrainer),
WordLevelTrainer(WordLevelTrainer),
UnigramTrainer(UnigramTrainer),
}
Variants§
BpeTrainer(BpeTrainer)
WordPieceTrainer(WordPieceTrainer)
WordLevelTrainer(WordLevelTrainer)
UnigramTrainer(UnigramTrainer)
Trait Implementations§
source§impl Clone for TrainerWrapper
impl Clone for TrainerWrapper
source§fn clone(&self) -> TrainerWrapper
fn clone(&self) -> TrainerWrapper
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'de> Deserialize<'de> for TrainerWrapper
impl<'de> Deserialize<'de> for TrainerWrapper
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<BpeTrainer> for TrainerWrapper
impl From<BpeTrainer> for TrainerWrapper
source§fn from(from: BpeTrainer) -> Self
fn from(from: BpeTrainer) -> Self
Converts to this type from the input type.
source§impl From<UnigramTrainer> for TrainerWrapper
impl From<UnigramTrainer> for TrainerWrapper
source§fn from(from: UnigramTrainer) -> Self
fn from(from: UnigramTrainer) -> Self
Converts to this type from the input type.
source§impl From<WordLevelTrainer> for TrainerWrapper
impl From<WordLevelTrainer> for TrainerWrapper
source§fn from(from: WordLevelTrainer) -> Self
fn from(from: WordLevelTrainer) -> Self
Converts to this type from the input type.
source§impl From<WordPieceTrainer> for TrainerWrapper
impl From<WordPieceTrainer> for TrainerWrapper
source§fn from(from: WordPieceTrainer) -> Self
fn from(from: WordPieceTrainer) -> Self
Converts to this type from the input type.
source§impl Serialize for TrainerWrapper
impl Serialize for TrainerWrapper
source§impl Trainer for TrainerWrapper
impl Trainer for TrainerWrapper
type Model = ModelWrapper
source§fn should_show_progress(&self) -> bool
fn should_show_progress(&self) -> bool
Whether we should show progress during the training.
source§fn train(&self, model: &mut ModelWrapper) -> Result<Vec<AddedToken>>
fn train(&self, model: &mut ModelWrapper) -> Result<Vec<AddedToken>>
The actual training method. This will return a new trained Model as well as a list
of
special_tokens
to be added directly to the tokenizer along with the model.Auto Trait Implementations§
impl Freeze for TrainerWrapper
impl RefUnwindSafe for TrainerWrapper
impl Send for TrainerWrapper
impl Sync for TrainerWrapper
impl Unpin for TrainerWrapper
impl UnwindSafe for TrainerWrapper
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