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