pub struct Lfm2Config {Show 18 fields
pub hidden_size: usize,
pub intermediate_size: usize,
pub num_attention_heads: usize,
pub num_hidden_layers: usize,
pub vocab_size: usize,
pub norm_eps: f32,
pub block_dim: Option<usize>,
pub block_ff_dim: Option<usize>,
pub layer_types: Vec<String>,
pub num_key_value_heads: Option<usize>,
pub rope_theta: Option<f64>,
pub quantization: Option<QuantizationConfig>,
pub bos_token_id: Option<u32>,
pub eos_token_id: Option<u32>,
pub attention_dropout: Option<f32>,
pub model_type: Option<String>,
pub tie_word_embeddings: Option<bool>,
pub head_dim: Option<usize>,
}Expand description
Model hyperparameters read from config.json (Llama and LFM2 layouts).
Fields§
Width of the residual stream.
intermediate_size: usizeWidth of the feed-forward (MLP) hidden layer.
num_attention_heads: usizeNumber of attention heads.
Number of transformer layers.
vocab_size: usizeNumber of tokens in the vocabulary.
norm_eps: f32Epsilon added inside RMSNorm; defaults to 1e-5.
block_dim: Option<usize>Hidden width used by LFM2 blocks, if set.
block_ff_dim: Option<usize>Feed-forward width used by LFM2 blocks, if set.
layer_types: Vec<String>Per-layer block type names (LFM2); empty when not given.
num_key_value_heads: Option<usize>Number of key/value heads for grouped-query attention, if set.
rope_theta: Option<f64>RoPE base frequency, if set.
quantization: Option<QuantizationConfig>Quantization settings, present for quantized checkpoints.
bos_token_id: Option<u32>Beginning-of-sequence token id, if set.
eos_token_id: Option<u32>End-of-sequence token id, if set.
attention_dropout: Option<f32>Attention dropout probability, if set.
model_type: Option<String>Hugging Face model_type, e.g. "llama" or "lfm2".
tie_word_embeddings: Option<bool>Whether lm_head shares the token-embedding matrix.
head_dim: Option<usize>Per-head dimension when it is not hidden_size / num_attention_heads.
Trait Implementations§
Source§impl Clone for Lfm2Config
impl Clone for Lfm2Config
Source§impl Debug for Lfm2Config
impl Debug for Lfm2Config
Source§impl<'de> Deserialize<'de> for Lfm2Config
impl<'de> Deserialize<'de> for Lfm2Config
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>,
Auto Trait Implementations§
impl Freeze for Lfm2Config
impl RefUnwindSafe for Lfm2Config
impl Send for Lfm2Config
impl Sync for Lfm2Config
impl Unpin for Lfm2Config
impl UnsafeUnpin for Lfm2Config
impl UnwindSafe for Lfm2Config
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
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> ⓘ
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> ⓘ
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