pub struct ModelConfig {Show 17 fields
pub vocab_size: usize,
pub hidden_size: usize,
pub intermediate_size: usize,
pub num_hidden_layers: usize,
pub num_attention_heads: usize,
pub num_key_value_heads: usize,
pub head_dim: usize,
pub sliding_window: usize,
pub num_local_experts: usize,
pub num_experts_per_tok: usize,
pub rms_norm_eps: f64,
pub max_position_embeddings: usize,
pub attention_bias: bool,
pub pad_token_id: Option<usize>,
pub rope_parameters: RopeParameters,
pub id2label: Option<HashMap<String, String>>,
pub label2id: Option<HashMap<String, usize>>,
}Fields§
§vocab_size: usize§intermediate_size: usize§num_attention_heads: usize§num_key_value_heads: usize§head_dim: usize§sliding_window: usize§num_local_experts: usize§num_experts_per_tok: usize§rms_norm_eps: f64§max_position_embeddings: usize§attention_bias: bool§pad_token_id: Option<usize>§rope_parameters: RopeParameters§id2label: Option<HashMap<String, String>>§label2id: Option<HashMap<String, usize>>Implementations§
Source§impl ModelConfig
impl ModelConfig
pub fn from_file(path: &Path) -> Result<Self>
Sourcepub fn num_key_value_groups(&self) -> usize
pub fn num_key_value_groups(&self) -> usize
Number of query heads per KV head group.
Sourcepub fn num_labels(&self) -> usize
pub fn num_labels(&self) -> usize
Total number of output labels (33 for BIOES over 8 categories + O).
Trait Implementations§
Source§impl Clone for ModelConfig
impl Clone for ModelConfig
Source§fn clone(&self) -> ModelConfig
fn clone(&self) -> ModelConfig
Returns a duplicate 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 ModelConfig
impl Debug for ModelConfig
Source§impl<'de> Deserialize<'de> for ModelConfig
impl<'de> Deserialize<'de> for ModelConfig
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 ModelConfig
impl RefUnwindSafe for ModelConfig
impl Send for ModelConfig
impl Sync for ModelConfig
impl Unpin for ModelConfig
impl UnsafeUnpin for ModelConfig
impl UnwindSafe for ModelConfig
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