mindspore.unified_safetensors
- mindspore.unified_safetensors(src_dir, src_strategy_file, dst_dir)[source]
Merge multiple safetensor files into a unified safetensor file.
- Parameters
- Raises
ValueError – If the safetensors file of rank is missing.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore as ms >>> src_dir = "/usr/safetensors/llama31B/4p_safetensors/" >>> src_strategy_file = "/usr/safetensors/llama31B/strategy_4p.ckpt" >>> dst_dir = "/usr/safetensors/llama31B/merge_llama31B_4p/" >>> ms.unified_safetensors(src_dir, src_strategy_file, dst_dir)