pub struct TrainingConfig {Show 13 fields
pub vocabulary_id: VocabularyId,
pub vocabulary_version: Version,
pub vocab_size: u32,
pub min_frequency: u64,
pub pretokenizer: Pretokenizer,
pub reserved_tokens: Vec<String>,
pub max_token_length: Option<usize>,
pub train_window: usize,
pub dictionary: Vec<String>,
pub max_corpus_units: Option<u64>,
pub seed: u64,
pub description: Option<String>,
pub license: Option<String>,
}Expand description
Everything a training run needs. Identical configuration and corpus must produce an identical vocabulary (FR-003 deterministic mode is the only mode in v0.1).
Fields§
§vocabulary_id: VocabularyId§vocabulary_version: Version§vocab_size: u32Target total number of tokens, including base and reserved tokens.
min_frequency: u64A candidate must occur at least this often to become a token.
pretokenizer: Pretokenizer§reserved_tokens: Vec<String>Special tokens appended after learned tokens. Never produced by encode.
max_token_length: Option<usize>Upper bound on a learned token’s length in units (bytes or symbols).
train_window: usizeWindow length used to split unsegmented input while counting.
dictionary: Vec<String>Fixed entries for the dictionary algorithm.
max_corpus_units: Option<u64>Job limit: refuse a corpus larger than this many units.
seed: u64Recorded for provenance. No v0.1 algorithm consumes randomness.
description: Option<String>§license: Option<String>Implementations§
Source§impl TrainingConfig
impl TrainingConfig
pub fn new(vocabulary_id: VocabularyId, vocab_size: u32) -> TrainingConfig
pub fn validate(&self) -> Result<(), KuteError>
Trait Implementations§
Source§impl Clone for TrainingConfig
impl Clone for TrainingConfig
Source§fn clone(&self) -> TrainingConfig
fn clone(&self) -> TrainingConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TrainingConfig
impl Debug for TrainingConfig
Source§impl<'de> Deserialize<'de> for TrainingConfig
impl<'de> Deserialize<'de> for TrainingConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TrainingConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TrainingConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TrainingConfig
impl PartialEq for TrainingConfig
Source§impl Serialize for TrainingConfig
impl Serialize for TrainingConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for TrainingConfig
Auto Trait Implementations§
impl Forget for TrainingConfig
impl Freeze for TrainingConfig
impl Move for TrainingConfig
impl RefUnwindSafe for TrainingConfig
impl Send for TrainingConfig
impl Sync for TrainingConfig
impl Unpin for TrainingConfig
impl UnsafeUnpin for TrainingConfig
impl UnwindSafe for TrainingConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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