Skip to main content

CodecArgs

Struct CodecArgs 

Source
pub(crate) struct CodecArgs {
Show 45 fields pub(crate) preset: Preset, pub(crate) vocab_size: Option<usize>, pub(crate) n_layer: Option<usize>, pub(crate) d_model: Option<usize>, pub(crate) n_head: Option<usize>, pub(crate) d_inner: Option<usize>, pub(crate) ctx_len: Option<usize>, pub(crate) dropout: Option<f32>, pub(crate) tie_embeddings: Option<bool>, pub(crate) position_type: Option<CliPositionType>, pub(crate) no_qk_norm: bool, pub(crate) norm_style: Option<CliNormStyle>, pub(crate) batch_size: Option<usize>, pub(crate) block_len: Option<usize>, pub(crate) online_loss: Option<CliOnlineLoss>, pub(crate) project_only_targets: Option<bool>, pub(crate) lr: Option<f64>, pub(crate) min_lr_ratio: Option<f64>, pub(crate) warmup: Option<usize>, pub(crate) clip: Option<f64>, pub(crate) adam_eps: Option<f64>, pub(crate) beta1: Option<f64>, pub(crate) beta2: Option<f64>, pub(crate) retrain_period: Option<usize>, pub(crate) retrain_len: Option<usize>, pub(crate) retrain_epochs: Option<usize>, pub(crate) retrain_early_epochs: Option<usize>, pub(crate) retrain_early_until: Option<usize>, pub(crate) retrain_lr: Option<String>, pub(crate) retrain_update_len: Option<usize>, pub(crate) retrain_batch_size: Option<usize>, pub(crate) seed: Option<u64>, pub(crate) dtype: Option<CliDType>, pub(crate) force_bf16: bool, pub(crate) device: Option<CliDevice>, pub(crate) max_tokens: Option<usize>, pub(crate) raw_bytes: Option<u64>, pub(crate) vocab_bytes: Option<u64>, pub(crate) vocab_file: Option<PathBuf>, pub(crate) initial_prior: Option<PathBuf>, pub(crate) log_interval: Option<usize>, pub(crate) checkpoint_dir: Option<PathBuf>, pub(crate) checkpoint_every_blocks: Option<usize>, pub(crate) stop_after_blocks: Option<usize>, pub(crate) run_dir: Option<PathBuf>,
}

Fields§

§preset: Preset

Configuration preset (tiny for fast local runs, v2 for full enwik9 settings).

§vocab_size: Option<usize>§n_layer: Option<usize>§d_model: Option<usize>§n_head: Option<usize>§d_inner: Option<usize>§ctx_len: Option<usize>§dropout: Option<f32>§tie_embeddings: Option<bool>§position_type: Option<CliPositionType>§no_qk_norm: bool§norm_style: Option<CliNormStyle>§batch_size: Option<usize>§block_len: Option<usize>§online_loss: Option<CliOnlineLoss>§project_only_targets: Option<bool>§lr: Option<f64>§min_lr_ratio: Option<f64>§warmup: Option<usize>§clip: Option<f64>§adam_eps: Option<f64>§beta1: Option<f64>§beta2: Option<f64>§retrain_period: Option<usize>§retrain_len: Option<usize>§retrain_epochs: Option<usize>§retrain_early_epochs: Option<usize>§retrain_early_until: Option<usize>§retrain_lr: Option<String>§retrain_update_len: Option<usize>§retrain_batch_size: Option<usize>§seed: Option<u64>§dtype: Option<CliDType>§force_bf16: bool§device: Option<CliDevice>§max_tokens: Option<usize>§raw_bytes: Option<u64>§vocab_bytes: Option<u64>§vocab_file: Option<PathBuf>§initial_prior: Option<PathBuf>§log_interval: Option<usize>§checkpoint_dir: Option<PathBuf>§checkpoint_every_blocks: Option<usize>§stop_after_blocks: Option<usize>§run_dir: Option<PathBuf>

Implementations§

Source§

impl CodecArgs

Source

pub(crate) fn build_config( &self, inferred_vocab_size: Option<usize>, ) -> Result<CodecConfig>

Trait Implementations§

Source§

impl Args for CodecArgs

Source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self via [FromArgMatches::from_arg_matches_mut] Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate self via [FromArgMatches::update_from_arg_matches_mut] Read more
Source§

impl Debug for CodecArgs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for CodecArgs

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more