pub struct Bundle {
pub path: PathBuf,
pub model: ModelConfig,
pub quantization: String,
pub group_size_default: usize,
pub hadamard_seed: Option<i64>,
pub tensors: HashMap<String, TensorData>,
/* private fields */
}Fields§
§path: PathBuf§model: ModelConfig§quantization: String§group_size_default: usize§hadamard_seed: Option<i64>§tensors: HashMap<String, TensorData>Implementations§
Source§impl Bundle
impl Bundle
pub fn weight_f32(&self, name: &str) -> Result<Vec<f32>, EngineError>
Sourcepub fn weight_loaded(&self, name: &str) -> Result<LoadedWeight, EngineError>
pub fn weight_loaded(&self, name: &str) -> Result<LoadedWeight, EngineError>
Load a weight in original space (Python reconstruct_weight).
Codebook tensors are stored rotated (W_rot = H@S@W on axis 0). Fused
hdm_linear unrotates y = W_rot @ x, which is valid for dense GEMM but
not for embedding row gather (e = W[token]). Unrotating the full
matrix here makes lookup, tied lm_head, and linear all match HF inject.
Sourcepub fn weight_f32_any(&self, names: &[&str]) -> Result<Vec<f32>, EngineError>
pub fn weight_f32_any(&self, names: &[&str]) -> Result<Vec<f32>, EngineError>
Load the first tensor that exists among names (HF vs tiny/blk aliases).
pub fn weight_loaded_any( &self, names: &[&str], ) -> Result<LoadedWeight, EngineError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Bundle
impl RefUnwindSafe for Bundle
impl Send for Bundle
impl Sync for Bundle
impl Unpin for Bundle
impl UnsafeUnpin for Bundle
impl UnwindSafe for Bundle
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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