pub struct Trainer { /* private fields */ }Expand description
High-level façade configuring and executing BPE training runs.
Implementations§
Source§impl Trainer
impl Trainer
Sourcepub fn new(cfg: TrainerConfig) -> Self
pub fn new(cfg: TrainerConfig) -> Self
Creates a new trainer for the supplied configuration.
Sourcepub fn builder() -> TrainerBuilder
pub fn builder() -> TrainerBuilder
Returns a TrainerBuilder with default settings.
Sourcepub fn config(&self) -> &TrainerConfig
pub fn config(&self) -> &TrainerConfig
Returns an immutable reference to the underlying configuration.
Sourcepub fn train_from_paths<P: AsRef<Path>>(
&self,
inputs: &[P],
ingest: &IngestConfig,
) -> Result<TrainerArtifacts>
pub fn train_from_paths<P: AsRef<Path>>( &self, inputs: &[P], ingest: &IngestConfig, ) -> Result<TrainerArtifacts>
Trains a model by loading files from disk according to IngestConfig.
Sourcepub fn train_from_sequences(
&self,
sequences: &[Vec<u8>],
) -> Result<TrainerArtifacts>
pub fn train_from_sequences( &self, sequences: &[Vec<u8>], ) -> Result<TrainerArtifacts>
Trains a model from in-memory byte sequences.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Trainer
impl RefUnwindSafe for Trainer
impl Send for Trainer
impl Sync for Trainer
impl Unpin for Trainer
impl UnwindSafe for Trainer
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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