pub enum ParserError {
Io {
path: String,
source: Error,
},
UnsupportedFormat {
path: String,
reason: String,
},
MissingTensor {
name: String,
path: String,
},
InvalidLayout {
path: String,
reason: String,
},
ExpertOutOfRange {
block: usize,
expert: usize,
available: usize,
},
LimitExceeded {
path: String,
limit: ParseLimitKind,
declared: u64,
budget: u64,
},
HostSizeOverflow {
path: String,
field: HostSizeField,
value: u64,
},
DuplicateTensorOwnership {
name: String,
shards: Vec<String>,
path: String,
},
MissingShard {
shard: String,
path: String,
},
FeatureDisabled {
path: String,
feature: &'static str,
},
}Expand description
Unified error type for checkpoint parsing and MoE weight extraction.
Variants§
Io
The underlying file could not be read.
UnsupportedFormat
The file is not a valid checkpoint (bad magic, unsupported version, unknown value type, unexpected Safetensors layout, …).
MissingTensor
A required tensor was not found in the checkpoint.
InvalidLayout
The checkpoint’s on-disk layout is internally inconsistent (tensor extends past EOF, element-count overflow, etc.).
ExpertOutOfRange
An expert index was out of range for the requested block or stacked tensor.
Fields
LimitExceeded
A crate::ParseLimits budget was exhausted by a file-declared value.
Fields
limit: ParseLimitKindBudget that was exhausted.
HostSizeOverflow
A file-declared u64 could not be represented as a host usize.
Fields
field: HostSizeFieldOn-wire field that overflowed.
DuplicateTensorOwnership
A tensor name is claimed by more than one Safetensors shard.
Fields
MissingShard
An index-referenced Safetensors shard is missing on disk.
Fields
FeatureDisabled
The input needs a backend whose cargo feature is not enabled
(for example Safetensors input without --features safetensors).
Trait Implementations§
Source§impl Debug for ParserError
impl Debug for ParserError
Source§impl Display for ParserError
impl Display for ParserError
Source§impl Error for ParserError
impl Error for ParserError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()