Expand description
Reading source .safetensors checkpoints. Opening/mmapping is delegated to
teeny_data::safetensors::SafeTensors; this module only adds the “upcast whatever float
dtype is on disk to f32 for quantization math” step.
Functions§
- is_
quantizable_ float - Whether
dtypeis oneread_f32can upcast from. - read_
f32 - Reads
view’s raw bytes asf32, upcasting fromF32/F16/BF16as needed. Integer or boolean source tensors (already-quantized inputs, masks, etc.) aren’t supported – callers should pass those through unquantized rather than routing them through this function. - read_
metadata - Reads a
.safetensorsfile’s__metadata__string map (e.g. the embeddedquantization_config– seecrate::format) directly frompath.