pub struct GgufBackend { /* private fields */ }Expand description
Checkpoint over an owned GgufLayout (whole file in memory).
Implementations§
Source§impl GgufBackend
impl GgufBackend
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self>
pub fn open(path: impl AsRef<Path>) -> Result<Self>
Read and parse a .gguf file with ParseLimits::default.
Sourcepub fn open_with_limits(
path: impl AsRef<Path>,
limits: ParseLimits,
) -> Result<Self>
pub fn open_with_limits( path: impl AsRef<Path>, limits: ParseLimits, ) -> Result<Self>
Read and parse a .gguf file with explicit limits.
Sourcepub fn from_bytes(bytes: Vec<u8>, label: impl Into<String>) -> Result<Self>
pub fn from_bytes(bytes: Vec<u8>, label: impl Into<String>) -> Result<Self>
Parse an in-memory GGUF buffer. label is used as the source path.
Sourcepub fn from_layout(layout: GgufLayout) -> Self
pub fn from_layout(layout: GgufLayout) -> Self
Wrap an already-parsed layout. The source kind is
SourceKind::SingleFile when layout.path names an existing
file, otherwise SourceKind::InMemory.
Sourcepub fn layout(&self) -> &GgufLayout
pub fn layout(&self) -> &GgufLayout
Format-specific layout (MoE helpers, suffix search, dequant).
Sourcepub fn into_layout(self) -> GgufLayout
pub fn into_layout(self) -> GgufLayout
Unwrap into the format-specific layout.
Trait Implementations§
Source§impl Checkpoint for GgufBackend
impl Checkpoint for GgufBackend
Source§fn source(&self) -> &CheckpointSource
fn source(&self) -> &CheckpointSource
Checkpoint identity: format, input path, root, payload files.
Source§fn tensors(&self) -> &[TensorInfo]
fn tensors(&self) -> &[TensorInfo]
Every tensor, sorted by name.
Source§fn metadata(&self) -> &CheckpointMetadata
fn metadata(&self) -> &CheckpointMetadata
Scalar metadata.
Source§fn tensor_bytes(&self, name: &str) -> Result<Cow<'_, [u8]>>
fn tensor_bytes(&self, name: &str) -> Result<Cow<'_, [u8]>>
Raw payload bytes of
name, length TensorInfo::byte_len.Source§fn format(&self) -> CheckpointFormat
fn format(&self) -> CheckpointFormat
Container format.
Auto Trait Implementations§
impl Forget for GgufBackend
impl Freeze for GgufBackendwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<(String, String)>: Freeze,
PhantomData<(String, u64)>: Freeze,
PhantomData<(String, i64)>: Freeze,
PhantomData<(String, f32)>: Freeze,
PhantomData<(String, f64)>: Freeze,
PhantomData<(String, Tensor)>: Freeze,
PhantomData<String>: Freeze,
PhantomData<TensorInfo>: Freeze,
*const LeafNode<String, MetadataValue> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, MetadataValue)>>: Freeze,
impl Move for GgufBackend
impl RefUnwindSafe for GgufBackend
impl Send for GgufBackendwhere
RawVecInner: Send,
RawTable<(String, String)>: Send,
RawTable<(String, u64)>: Send,
RawTable<(String, i64)>: Send,
RawTable<(String, f32)>: Send,
RawTable<(String, f64)>: Send,
RawTable<(String, Tensor)>: Send,
NodeRef<Owned, String, MetadataValue, LeafOrInternal>: Send,
BoxRaw<(String, MetadataValue)>: Send,
impl Sync for GgufBackendwhere
RawVecInner: Sync,
RawTable<(String, String)>: Sync,
RawTable<(String, u64)>: Sync,
RawTable<(String, i64)>: Sync,
RawTable<(String, f32)>: Sync,
RawTable<(String, f64)>: Sync,
RawTable<(String, Tensor)>: Sync,
NodeRef<Owned, String, MetadataValue, LeafOrInternal>: Sync,
BoxRaw<(String, MetadataValue)>: Sync,
impl Unpin for GgufBackend
impl UnsafeUnpin for GgufBackendwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
PhantomData<(String, u64)>: UnsafeUnpin,
PhantomData<(String, i64)>: UnsafeUnpin,
PhantomData<(String, f32)>: UnsafeUnpin,
PhantomData<(String, f64)>: UnsafeUnpin,
PhantomData<(String, Tensor)>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<TensorInfo>: UnsafeUnpin,
*const LeafNode<String, MetadataValue> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, MetadataValue)>>: UnsafeUnpin,
impl UnwindSafe for GgufBackendwhere
RawVecInner: UnwindSafe,
HashMap<String, String>: UnwindSafe,
HashMap<String, u64>: UnwindSafe,
HashMap<String, i64>: UnwindSafe,
HashMap<String, f32>: UnwindSafe,
HashMap<String, f64>: UnwindSafe,
HashMap<String, Tensor>: UnwindSafe,
BTreeMap<String, MetadataValue>: 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