Struct candle_transformers::models::llama::LlamaConfig
source · pub struct LlamaConfig {
pub hidden_size: usize,
pub intermediate_size: usize,
pub vocab_size: usize,
pub num_hidden_layers: usize,
pub num_attention_heads: usize,
pub num_key_value_heads: Option<usize>,
pub rms_norm_eps: f64,
pub rope_theta: f32,
pub bos_token_id: Option<u32>,
pub eos_token_id: Option<u32>,
}
Fields§
§intermediate_size: usize
§vocab_size: usize
§num_attention_heads: usize
§num_key_value_heads: Option<usize>
§rms_norm_eps: f64
§rope_theta: f32
§bos_token_id: Option<u32>
§eos_token_id: Option<u32>
Implementations§
source§impl LlamaConfig
impl LlamaConfig
pub fn num_key_value_heads(&self) -> usize
source§impl LlamaConfig
impl LlamaConfig
pub fn into_config(self, use_flash_attn: bool) -> Config
Trait Implementations§
source§impl Clone for LlamaConfig
impl Clone for LlamaConfig
source§fn clone(&self) -> LlamaConfig
fn clone(&self) -> LlamaConfig
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 Debug for LlamaConfig
impl Debug for LlamaConfig
source§impl<'de> Deserialize<'de> for LlamaConfig
impl<'de> Deserialize<'de> for LlamaConfig
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
Auto Trait Implementations§
impl Freeze for LlamaConfig
impl RefUnwindSafe for LlamaConfig
impl Send for LlamaConfig
impl Sync for LlamaConfig
impl Unpin for LlamaConfig
impl UnwindSafe for LlamaConfig
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