pub struct GgufLoader<B: Backend + BackendQuantGguf + BackendQuantMarlin> { /* private fields */ }Expand description
Backend-generic weight loader for GGUF files.
Build with GgufLoader::open. The underlying file stays mmap’d for
the lifetime of the loader so per-tensor reads only do byte slicing,
not file I/O.
Implementations§
Source§impl<B: Backend + BackendQuantGguf + BackendQuantMarlin> GgufLoader<B>
impl<B: Backend + BackendQuantGguf + BackendQuantMarlin> GgufLoader<B>
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self>
pub fn open(path: impl AsRef<Path>) -> Result<Self>
Open and parse a .gguf file. Tensor payloads stay on disk (mmap’d)
until each load_tensor / load_linear call.
Trait Implementations§
Source§impl<B: Backend + BackendQuantGguf + BackendQuantMarlin> WeightLoader<B> for GgufLoader<B>
impl<B: Backend + BackendQuantGguf + BackendQuantMarlin> WeightLoader<B> for GgufLoader<B>
Source§fn load_tensor(&self, name: &str) -> Result<B::Buffer>
fn load_tensor(&self, name: &str) -> Result<B::Buffer>
Load a single tensor by fully qualified name
(e.g.
"model.embed_tokens.weight").Source§fn load_linear(&self, name: &str) -> Result<Box<dyn Linear<B>>>
fn load_linear(&self, name: &str) -> Result<Box<dyn Linear<B>>>
Load a projection as a
Linear<B>. The concrete implementation
(DenseLinear / GptqLinear / AwqLinear / GgufLinear) depends on the
loader’s file format and quant config. Read moreSource§fn has_tensor(&self, name: &str) -> bool
fn has_tensor(&self, name: &str) -> bool
Whether a tensor with this name exists in the source.
Source§fn quant_config(&self) -> Option<&QuantConfig>
fn quant_config(&self) -> Option<&QuantConfig>
Quantization metadata (parsed from
quantize_config.json or a GGUF header).
None means the source is dense.Auto Trait Implementations§
impl<B> Freeze for GgufLoader<B>
impl<B> RefUnwindSafe for GgufLoader<B>where
B: RefUnwindSafe,
impl<B> Send for GgufLoader<B>
impl<B> Sync for GgufLoader<B>
impl<B> Unpin for GgufLoader<B>where
B: Unpin,
impl<B> UnsafeUnpin for GgufLoader<B>
impl<B> UnwindSafe for GgufLoader<B>where
B: UnwindSafe,
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<T> ErasedDestructor for Twhere
T: 'static,
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