报错 Some tensors share memory, this will lead to duplicate memoryon disk and potential differences 原因 safetensors在保存模型时无法处理共享张量。 共享张量是PyTorch中用于减少内存使用并提高计算效率的特性,允许多个张量引用相同的内存空间。 解决方案 accelerator.save_state(save_path, safe_serialization = False)