pub trait WeightSource {
// Required methods
fn describe(&self, name: &str) -> Result<(GgmlType, Vec<u64>)>;
fn row_bytes(
&mut self,
name: &str,
first: usize,
count: usize,
) -> Result<Vec<u8>>;
fn has(&self, name: &str) -> bool;
}Expand description
Where the reference reads a model’s weights: a checkpoint, or tensors held in memory (a test’s tiny model).
Tensors are named and laid out as GGUF names and lays them out (dims[0] the fastest).
Required Methods§
Sourcefn row_bytes(
&mut self,
name: &str,
first: usize,
count: usize,
) -> Result<Vec<u8>>
fn row_bytes( &mut self, name: &str, first: usize, count: usize, ) -> Result<Vec<u8>>
The bytes of rows [first, first + count), a row being the tensor’s dims[0] elements.
fn has(&self, name: &str) -> bool
Implementors§
impl WeightSource for GgufHeader
A header as a checkpoint’s weights: every tensor’s format and dims and none of its bytes, what lays the checkpoint out on the card and lowers its step.