pub struct ModelWeights {
pub embed_tokens: DenseWeight,
pub final_norm: DenseWeight,
pub lm_head: DenseWeight,
pub layers: Vec<LayerWeights>,
}Expand description
2026-09-25: Whole-model weights built by ModelWeights::from_store.
Fields§
§embed_tokens: DenseWeight§final_norm: DenseWeight§lm_head: DenseWeight2026-09-25: lm_head.weight, or embed_tokens when the checkpoint has none.
layers: Vec<LayerWeights>Implementations§
Source§impl ModelWeights
impl ModelWeights
Sourcepub fn from_store(
store: &WeightStore,
layer_types: &[LayerType],
num_experts: usize,
gpu: &dyn GpuBackend,
config: &ModelConfig,
) -> Result<Self>
pub fn from_store( store: &WeightStore, layer_types: &[LayerType], num_experts: usize, gpu: &dyn GpuBackend, config: &ModelConfig, ) -> Result<Self>
2026-09-25: Build typed weight references from a flat WeightStore,
loading every layer as Nvfp4Variant::Standard.
layer_types[i] must be FullAttention or LinearAttention: SparseAttention
is an error, and SlidingAttention or Moe panics.
Auto Trait Implementations§
impl Freeze for ModelWeights
impl RefUnwindSafe for ModelWeights
impl Send for ModelWeights
impl Sync for ModelWeights
impl Unpin for ModelWeights
impl UnwindSafe for ModelWeights
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