generated at
safetensors
>This repository implements a new simple format for storing tensors safely (as opposed to pickle) and that is still fast (zero-copy).


>通常のPyTorchモデルのチェックポイントファイル(通常は.ptまたは.ckpt、時には.bin)にはPythonのコードを含めることができ、基本的にあなたのPCに対して何でもできるようになります。
>一方、SafeTensorsはデータ、つまり数字だけで、コードはありません。さらに、ロードの仕組みが改善されているので、理論的にはGPUへのロードが速くなるはずです。


使うだけなら基本的にckptよりsafetensorsを使ったほうがいいのかな?基素
YES!基素
ほぼ完璧に上位互換ですねnomadoor
safetensorsに追加学習はできないっぽい?
>Flexibility: Can I save custom code in the format and be able to use it later with zero extra code ? (~ means we can store more than pure tensors, but no custom code)

.ckptは、pickleでserialize
>関数だってピクル化できてしまう
>もしもckptファイルが悪意をもって作成されていた場合、使用時に非ピクル化すると同時に任意コードが実行される

https://zenn.dev/platina/articles/e65c73cb01a900Safetensors のヘッダーを読む