pub struct ModelInfo {Show 14 fields
pub model_id: ModelId,
pub model_type: ModelType,
pub num_parameters: u64,
pub hidden_size: usize,
pub num_layers: usize,
pub num_heads: usize,
pub num_kv_heads: usize,
pub vocab_size: usize,
pub max_sequence_length: usize,
pub dtype: DataType,
pub device: Device,
pub version: Option<String>,
pub license: Option<String>,
pub metadata: HashMap<String, Value>,
}Expand description
Model information and metadata
Fields§
§model_id: ModelIdModel identifier
model_type: ModelTypeModel type/architecture
num_parameters: u64Number of parameters
Hidden dimension size
num_layers: usizeNumber of transformer layers
num_heads: usizeNumber of attention heads
num_kv_heads: usizeNumber of key-value heads (for GQA)
vocab_size: usizeVocabulary size
max_sequence_length: usizeMaximum sequence length
dtype: DataTypeData type used by the model
device: DeviceDevice where model is loaded
version: Option<String>Model version or revision
license: Option<String>Model license
metadata: HashMap<String, Value>Additional model metadata
Implementations§
Source§impl ModelInfo
impl ModelInfo
Sourcepub fn estimated_size_bytes(&self) -> u64
pub fn estimated_size_bytes(&self) -> u64
Calculate approximate model size in bytes
Sourcepub fn supports_sequence_length(&self, length: usize) -> bool
pub fn supports_sequence_length(&self, length: usize) -> bool
Check if model supports a specific sequence length
Sourcepub fn memory_requirements(
&self,
batch_size: usize,
sequence_length: usize,
) -> ModelMemoryRequirements
pub fn memory_requirements( &self, batch_size: usize, sequence_length: usize, ) -> ModelMemoryRequirements
Get memory requirements for inference
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ModelInfo
impl<'de> Deserialize<'de> for ModelInfo
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModelInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModelInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ModelInfo
impl Serialize for ModelInfo
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ModelInfo
impl RefUnwindSafe for ModelInfo
impl Send for ModelInfo
impl Sync for ModelInfo
impl Unpin for ModelInfo
impl UnsafeUnpin for ModelInfo
impl UnwindSafe for ModelInfo
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> 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>
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