pub struct Packed {
pub cfg: Qwen4ExpConfig,
pub manifest: Manifest,
pub dir: PathBuf,
pub dense: Mmap,
pub experts: Mmap,
pub experts_file: File,
pub ngram: Mmap,
}Fields§
§cfg: Qwen4ExpConfig§manifest: Manifest§dir: PathBuf§dense: Mmap§experts: Mmap§experts_file: FileOpen handle on experts.bin for advisory reads (prefetch).
ngram: MmapImplementations§
Source§impl Packed
impl Packed
Sourcepub fn open(model_dir: &Path) -> Result<Self>
pub fn open(model_dir: &Path) -> Result<Self>
model_dir holds config.json and tokenizer.json; the packed files
live in model_dir/packed, or directly in a standalone packed directory.
pub fn dense_bytes(&self, name: &str) -> Result<&[u8]>
pub fn shape(&self, name: &str) -> Result<&[usize]>
pub fn bf16(&self, name: &str) -> Result<&[bf16]>
pub fn i64s(&self, name: &str) -> Result<Vec<i64>>
Sourcepub(super) fn ngram_metadata(&self, prefix: &str) -> Result<NgramMetadata>
pub(super) fn ngram_metadata(&self, prefix: &str) -> Result<NgramMetadata>
Read a PLE embedding’s hash parameters from the dense store for either backend.
Sourcepub fn qlinear(&self, prefix: &str) -> Result<QLinear<'_>>
pub fn qlinear(&self, prefix: &str) -> Result<QLinear<'_>>
Affine 4-bit group-64 linear layer {prefix}.{weight,scales,biases}.
Sourcepub fn expert_layer(&self, layer: usize) -> usize
pub fn expert_layer(&self, layer: usize) -> usize
Record index for a main decoder layer’s expert block.
Sourcepub fn mtp_expert_layer(&self, i: usize) -> Result<usize>
pub fn mtp_expert_layer(&self, i: usize) -> Result<usize>
Record index for MTP layer i’s expert block.
pub fn record_offset(&self, record_layer: usize, expert: usize) -> usize
pub fn expert(&self, record_layer: usize, expert: usize) -> ExpertRef<'_>
Auto Trait Implementations§
impl Freeze for Packed
impl RefUnwindSafe for Packed
impl Send for Packed
impl Sync for Packed
impl Unpin for Packed
impl UnsafeUnpin for Packed
impl UnwindSafe for Packed
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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