pub enum WeightFormat {
Safetensors {
dir: PathBuf,
},
Gguf {
path: PathBuf,
},
}Expand description
Resolved weight format + path. Produced by WeightFormat::detect
from a user-supplied path (HF cache snapshot, local dir, or a
.gguf file).
Variants§
Safetensors
HuggingFace safetensors directory: config.json + one or more
.safetensors shards. The on-disk weights may be plain FP16/BF16
or GPTQ-Int4 (<name>.qweight tensors); this is decided
per-tensor by NativeSafetensorsLoader::load_linear.
Gguf
GGUF single-file format (Llama-family / Qwen3-MoE quantized).
Loaded by ferrum_quantization::gguf::GgufLoader.
Implementations§
Source§impl WeightFormat
impl WeightFormat
Sourcepub fn detect(path: &Path) -> Result<Self>
pub fn detect(path: &Path) -> Result<Self>
Detect the weight format from a user-supplied path.
- If
pathis a file ending in.gguf(case-insensitive) →WeightFormat::Gguf. - If
pathis a directory containingconfig.json→WeightFormat::Safetensors. - Anything else returns a model error.
Trait Implementations§
Source§impl Clone for WeightFormat
impl Clone for WeightFormat
Source§fn clone(&self) -> WeightFormat
fn clone(&self) -> WeightFormat
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WeightFormat
impl RefUnwindSafe for WeightFormat
impl Send for WeightFormat
impl Sync for WeightFormat
impl Unpin for WeightFormat
impl UnsafeUnpin for WeightFormat
impl UnwindSafe for WeightFormat
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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