Skip to main content

GgufBackend

Struct GgufBackend 

Source
pub struct GgufBackend { /* private fields */ }
Expand description

Checkpoint over an owned GgufLayout (whole file in memory).

Implementations§

Source§

impl GgufBackend

Source

pub fn open(path: impl AsRef<Path>) -> Result<Self>

Read and parse a .gguf file with ParseLimits::default.

Source

pub fn open_with_limits( path: impl AsRef<Path>, limits: ParseLimits, ) -> Result<Self>

Read and parse a .gguf file with explicit limits.

Source

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.

Source

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.

Source

pub fn layout(&self) -> &GgufLayout

Format-specific layout (MoE helpers, suffix search, dequant).

Source

pub fn into_layout(self) -> GgufLayout

Unwrap into the format-specific layout.

Trait Implementations§

Source§

impl Checkpoint for GgufBackend

Source§

fn source(&self) -> &CheckpointSource

Checkpoint identity: format, input path, root, payload files.
Source§

fn tensors(&self) -> &[TensorInfo]

Every tensor, sorted by name.
Source§

fn metadata(&self) -> &CheckpointMetadata

Scalar metadata.
Source§

fn tensor_bytes(&self, name: &str) -> Result<Cow<'_, [u8]>>

Raw payload bytes of name, length TensorInfo::byte_len.
Source§

fn format(&self) -> CheckpointFormat

Container format.
Source§

fn tensor(&self, name: &str) -> Option<&TensorInfo>

Look up one tensor by exact name.
Source§

impl Debug for GgufBackend

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for GgufBackend

§

impl Freeze for GgufBackend

§

impl Move for GgufBackend

§

impl RefUnwindSafe for GgufBackend

§

impl Send for GgufBackend
where 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 GgufBackend
where 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
where *const u8 is !null: Unpin, *const LeafNode<String, MetadataValue> is !null: Unpin, Box<(String, MetadataValue)>: Unpin,

§

impl UnsafeUnpin for GgufBackend

§

impl UnwindSafe for GgufBackend

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.