#[non_exhaustive]pub enum AnyCheckpoint {
Gguf(GgufBackend),
GgufMmap(GgufMmapBackend),
Safetensors(SafetensorsBackend),
SafetensorsMmap(SafetensorsMmapBackend),
}Expand description
A checkpoint whose backend was chosen at runtime.
Implements Checkpoint by delegation. The as_* accessors return
the format-specific handle when consumers need format-only features.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Gguf(GgufBackend)
Owned GGUF layout.
GgufMmap(GgufMmapBackend)
Memory-mapped GGUF layout.
Safetensors(SafetensorsBackend)
Safetensors with bounded owned reads.
SafetensorsMmap(SafetensorsMmapBackend)
Memory-mapped Safetensors shards.
Implementations§
Source§impl AnyCheckpoint
impl AnyCheckpoint
Sourcepub fn as_dyn(&self) -> &dyn Checkpoint
pub fn as_dyn(&self) -> &dyn Checkpoint
The active backend as a trait object.
Sourcepub fn as_gguf(&self) -> Option<&GgufLayout>
pub fn as_gguf(&self) -> Option<&GgufLayout>
Owned GGUF layout, for
crate::analysis::moe::list_experts /
crate::analysis::moe::extract_expert.
Sourcepub fn as_gguf_mmap(&self) -> Option<&GgufLayoutMmap>
pub fn as_gguf_mmap(&self) -> Option<&GgufLayoutMmap>
Memory-mapped GGUF layout.
Sourcepub fn as_safetensors(&self) -> Option<&SafetensorsCheckpoint>
pub fn as_safetensors(&self) -> Option<&SafetensorsCheckpoint>
Safetensors handle (manifest, MoE candidates, record lookup).
Sourcepub fn as_safetensors_mmap(&self) -> Option<&SafetensorsCheckpointMmap>
pub fn as_safetensors_mmap(&self) -> Option<&SafetensorsCheckpointMmap>
Memory-mapped Safetensors handle.
Trait Implementations§
Source§impl Checkpoint for AnyCheckpoint
impl Checkpoint for AnyCheckpoint
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 AnyCheckpoint
impl Freeze for AnyCheckpointwhere
*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,
*mut c_void: Freeze,
&'static str: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
PhantomData<SafetensorsTensorRecord>: Freeze,
PhantomData<SafetensorsRouterCandidate>: Freeze,
PhantomData<SafetensorsExpertGroup>: Freeze,
*const LeafNode<String, ResolvedShard> is !null: Freeze,
PhantomData<Box<(String, ResolvedShard)>>: Freeze,
*const LeafNode<String, usize> is !null: Freeze,
PhantomData<Box<(String, usize)>>: Freeze,
*const LeafNode<String, MappedShard> is !null: Freeze,
PhantomData<Box<(String, MappedShard)>>: Freeze,
impl Move for AnyCheckpoint
impl RefUnwindSafe for AnyCheckpoint
impl Send for AnyCheckpointwhere
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,
MmapInner: Send,
&'static str: Send,
NodeRef<Owned, String, String, LeafOrInternal>: Send,
BoxRaw<(String, String)>: Send,
NodeRef<Owned, String, ResolvedShard, LeafOrInternal>: Send,
BoxRaw<(String, ResolvedShard)>: Send,
NodeRef<Owned, String, usize, LeafOrInternal>: Send,
BoxRaw<(String, usize)>: Send,
NodeRef<Owned, String, MappedShard, LeafOrInternal>: Send,
BoxRaw<(String, MappedShard)>: Send,
impl Sync for AnyCheckpointwhere
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,
MmapInner: Sync,
NodeRef<Owned, String, String, LeafOrInternal>: Sync,
BoxRaw<(String, String)>: Sync,
NodeRef<Owned, String, ResolvedShard, LeafOrInternal>: Sync,
BoxRaw<(String, ResolvedShard)>: Sync,
NodeRef<Owned, String, usize, LeafOrInternal>: Sync,
BoxRaw<(String, usize)>: Sync,
NodeRef<Owned, String, MappedShard, LeafOrInternal>: Sync,
BoxRaw<(String, MappedShard)>: Sync,
impl Unpin for AnyCheckpointwhere
*const u8 is !null: Unpin,
*const LeafNode<String, MetadataValue> is !null: Unpin,
Box<(String, MetadataValue)>: Unpin,
*mut c_void: Unpin,
&'static str: Unpin,
*const LeafNode<String, String> is !null: Unpin,
Box<(String, String)>: Unpin,
*const LeafNode<String, ResolvedShard> is !null: Unpin,
Box<(String, ResolvedShard)>: Unpin,
*const LeafNode<String, usize> is !null: Unpin,
Box<(String, usize)>: Unpin,
*const LeafNode<String, MappedShard> is !null: Unpin,
Box<(String, MappedShard)>: Unpin,
impl UnsafeUnpin for AnyCheckpointwhere
*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,
*mut c_void: UnsafeUnpin,
&'static str: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
PhantomData<SafetensorsTensorRecord>: UnsafeUnpin,
PhantomData<SafetensorsRouterCandidate>: UnsafeUnpin,
PhantomData<SafetensorsExpertGroup>: UnsafeUnpin,
*const LeafNode<String, ResolvedShard> is !null: UnsafeUnpin,
PhantomData<Box<(String, ResolvedShard)>>: UnsafeUnpin,
*const LeafNode<String, usize> is !null: UnsafeUnpin,
PhantomData<Box<(String, usize)>>: UnsafeUnpin,
*const LeafNode<String, MappedShard> is !null: UnsafeUnpin,
PhantomData<Box<(String, MappedShard)>>: UnsafeUnpin,
impl UnwindSafe for AnyCheckpointwhere
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,
*mut c_void: UnwindSafe,
&'static str: UnwindSafe,
BTreeMap<String, String>: UnwindSafe,
BTreeMap<String, ResolvedShard>: UnwindSafe,
BTreeMap<String, usize>: UnwindSafe,
BTreeMap<String, MappedShard>: 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