Module safetensors

Module safetensors 

Source
Expand description

Safetensors — interoperable tensor serialization (HuggingFace format).

Functions§

from_bytes
Deserialize named tensors from an in-memory safetensors byte slice.
load
Load named tensors from a .safetensors file.
load_state_dict
Load parameters from a .safetensors file into a state-dict map.
read_safetensors
Read named tensors from safetensors format.
save
Save named tensors to a .safetensors file.
save_module
Save a module’s parameters to a .safetensors file using its named_parameters().
to_bytes
Serialize named tensors to an in-memory byte vector in safetensors format.
write_safetensors
Write named tensors in safetensors format to a writer.