Skip to main content

Module serialization

Module serialization 

Source
Expand description

SafeTensors saving: named tensors -> file.

There is deliberately no generic loader here. Model loading goes through crate::models::gpt2::Gpt2::from_safetensors_bytes, which deserializes straight into the model’s own parameter layout rather than materializing an intermediate HashMap<String, Tensor> of every tensor in the file.

Functions§

save_safetensors
Save named f32 tensors to a .safetensors file (checkpoints). Entries: (name, shape, host data).