pub struct HfCheckpoint { /* private fields */ }Expand description
A Hugging Face checkpoint directory, presented as its converted GGUF.
Implementations§
Source§impl HfCheckpoint
impl HfCheckpoint
Sourcepub fn open(dir: &Path) -> Result<HfCheckpoint>
pub fn open(dir: &Path) -> Result<HfCheckpoint>
Read the checkpoint in dir as its converted GGUF.
Sourcepub fn read_configuration(
dir: &Path,
) -> Result<(String, BTreeMap<String, MetaValue>)>
pub fn read_configuration( dir: &Path, ) -> Result<(String, BTreeMap<String, MetaValue>)>
The architecture and the metadata dir’s config.json alone writes, refused as HfCheckpoint::open refuses
it, before any weight is read: a published configuration checked without its checkpoint. Draft blocks only the
tensors count (Qwen3-Next’s) are left uncounted.
Sourcepub fn read_tokenizer(dir: &Path) -> Result<BTreeMap<String, MetaValue>>
pub fn read_tokenizer(dir: &Path) -> Result<BTreeMap<String, MetaValue>>
The tokenizer keys dir’s tokenizer files and configuration write (tokenizer.*, with general.architecture),
before any weight is read: a published tokenizer checked without its checkpoint.
Sourcepub fn open_with(dir: &Path, recompute: Recompute) -> Result<HfCheckpoint>
pub fn open_with(dir: &Path, recompute: Recompute) -> Result<HfCheckpoint>
Read the checkpoint in dir, presenting computed values as recompute says.
Sourcepub fn tokenizer_meta(&self) -> Result<&BTreeMap<String, MetaValue>>
pub fn tokenizer_meta(&self) -> Result<&BTreeMap<String, MetaValue>>
The tokenizer keys the converter writes from the directory’s tokenizer files (tokenizer.*), with
general.architecture: what Vocab::from_meta reads. Read on first use.
Sourcepub fn unread(&self) -> &[String]
pub fn unread(&self) -> &[String]
Tensors of the checkpoint nothing presented reads and the converter does not skip.
Sourcepub fn skipped(&self) -> &[String]
pub fn skipped(&self) -> &[String]
Tensors the converter skips (a multimodal checkpoint’s tower), which this reader skips too.
Sourcepub fn recomputed(&self) -> Vec<&str>
pub fn recomputed(&self) -> Vec<&str>
Tensors whose values a converter step computes from the stored ones, rather than reads.
Sourcepub fn shard_count(&self) -> usize
pub fn shard_count(&self) -> usize
The safetensors files read.
pub fn dir(&self) -> &Path
Trait Implementations§
Source§impl SpecSource for HfCheckpoint
impl SpecSource for HfCheckpoint
Auto Trait Implementations§
impl !Freeze for HfCheckpoint
impl RefUnwindSafe for HfCheckpoint
impl Send for HfCheckpoint
impl Sync for HfCheckpoint
impl Unpin for HfCheckpoint
impl UnsafeUnpin for HfCheckpoint
impl UnwindSafe for HfCheckpoint
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.