pub struct CommandRConfig {Show 28 fields
pub model_name: String,
pub vocab_size: usize,
pub hidden_size: usize,
pub num_attention_heads: usize,
pub num_key_value_heads: usize,
pub num_hidden_layers: usize,
pub intermediate_size: usize,
pub max_sequence_length: usize,
pub rms_norm_eps: f32,
pub rope_theta: f32,
pub rope_scaling_factor: f32,
pub attention_dropout: f32,
pub hidden_dropout: f32,
pub use_bias: bool,
pub tie_word_embeddings: bool,
pub activation_function: String,
pub layer_norm_eps: f32,
pub use_logit_bias: bool,
pub logit_scale: f32,
pub use_sliding_window: bool,
pub sliding_window_size: usize,
pub use_flash_attention: bool,
pub pad_token_id: Option<usize>,
pub bos_token_id: Option<usize>,
pub eos_token_id: Option<usize>,
pub model_type: String,
pub torch_dtype: String,
pub transformers_version: String,
}Expand description
Configuration for Command R models
Fields§
§model_name: StringModel name
vocab_size: usizeVocabulary size
Hidden size
num_attention_heads: usizeNumber of attention heads
num_key_value_heads: usizeNumber of key-value heads (for GQA)
Number of hidden layers
intermediate_size: usizeIntermediate size in FFN
max_sequence_length: usizeMaximum sequence length
rms_norm_eps: f32RMS normalization epsilon
rope_theta: f32Rope theta
rope_scaling_factor: f32Rope scaling factor
attention_dropout: f32Attention dropout
Hidden dropout
use_bias: boolUse bias in linear layers
tie_word_embeddings: boolTie word embeddings
activation_function: StringActivation function
layer_norm_eps: f32Layer norm epsilon
use_logit_bias: boolUse logit bias
logit_scale: f32Logit scale
use_sliding_window: boolUse sliding window attention
sliding_window_size: usizeSliding window size
use_flash_attention: boolUse flash attention
pad_token_id: Option<usize>Pad token id
bos_token_id: Option<usize>BOS token id
eos_token_id: Option<usize>EOS token id
model_type: StringModel type
torch_dtype: StringTorch dtype
transformers_version: StringTransformers version
Implementations§
Source§impl CommandRConfig
impl CommandRConfig
Sourcepub fn tiny() -> Self
pub fn tiny() -> Self
Create a tiny configuration for testing purposes Uses very small dimensions to allow fast test execution
Sourcepub fn command_r_plus() -> Self
pub fn command_r_plus() -> Self
Create Command R+ model configuration
Sourcepub fn command_r_08_2024() -> Self
pub fn command_r_08_2024() -> Self
Create Command R 08-2024 model configuration
Sourcepub fn command_r_plus_08_2024() -> Self
pub fn command_r_plus_08_2024() -> Self
Create Command R+ 08-2024 model configuration
Sourcepub fn kv_head_dim(&self) -> usize
pub fn kv_head_dim(&self) -> usize
Get the key-value head dimension
Sourcepub fn num_query_groups(&self) -> usize
pub fn num_query_groups(&self) -> usize
Get the number of query groups
Trait Implementations§
Source§impl Clone for CommandRConfig
impl Clone for CommandRConfig
Source§fn clone(&self) -> CommandRConfig
fn clone(&self) -> CommandRConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Config for CommandRConfig
impl Config for CommandRConfig
Source§impl Debug for CommandRConfig
impl Debug for CommandRConfig
Source§impl Default for CommandRConfig
impl Default for CommandRConfig
Source§impl<'de> Deserialize<'de> for CommandRConfig
impl<'de> Deserialize<'de> for CommandRConfig
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 CommandRConfig
impl RefUnwindSafe for CommandRConfig
impl Send for CommandRConfig
impl Sync for CommandRConfig
impl Unpin for CommandRConfig
impl UnsafeUnpin for CommandRConfig
impl UnwindSafe for CommandRConfig
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,
Source§impl<T> ConfigSerializable for Twhere
T: Serialize + for<'de> Deserialize<'de>,
impl<T> ConfigSerializable for Twhere
T: Serialize + for<'de> Deserialize<'de>,
Source§fn save_to_file(&self, path: &Path) -> Result<(), TrustformersError>
fn save_to_file(&self, path: &Path) -> Result<(), TrustformersError>
Source§fn load_from_file(path: &Path) -> Result<Self, TrustformersError>where
Self: Sized,
fn load_from_file(path: &Path) -> Result<Self, TrustformersError>where
Self: Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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