Safetensors 文件
Tensorflow API
您目前正在檢視 main 版本,這需要從原始碼安裝。如果您想使用一般的 pip 安裝,請查看最新的穩定版本 (v0.5.0-rc.0)。
加入 Hugging Face 社群
並獲得增強的文件體驗
開始使用
Tensorflow API
safetensors.tensorflow.load_file
< 原始碼 >( filename: typing.Union[str, os.PathLike] ) → Dict[str, tf.Tensor]
將 safetensors 檔案載入為 tensorflow 格式。
safetensors.tensorflow.load
< 原始碼 >( data: bytes ) → Dict[str, tf.Tensor]
從純位元組 (bytes) 將 safetensors 檔案載入為 tensorflow 格式。
safetensors.tensorflow.save_file
< 原始碼 >( tensors: typing.Dict[str, tensorflow.python.framework.tensor.Tensor] filename: typing.Union[str, os.PathLike] metadata: typing.Optional[typing.Dict[str, str]] = None ) → None
將張量字典保存為 safetensors 格式的原始位元組。
safetensors.tensorflow.save
< 原始碼 >( tensors: typing.Dict[str, tensorflow.python.framework.tensor.Tensor] metadata: typing.Optional[typing.Dict[str, str]] = None ) → bytes
將張量字典保存為 safetensors 格式的原始位元組。