Installation
pip install safetensors
Usage
Numpy
from safetensors.numpy import save_file, load_file
import numpy as np
tensors = {
"a": np.zeros((2, 2)),
"b": np.zeros((2, 3), dtype=np.uint8)
}
save_file(tensors, "./model.safetensors")
# Now loading
loaded = load_file("./model.safetensors")
Torch
from safetensors.torch import save_file, load_file
import torch
tensors = {
"a": torch.zeros((2, 2)),
"b": torch.zeros((2, 3), dtype=torch.uint8)
}
save_file(tensors, "./model.safetensors")
# Now loading
loaded = load_file("./model.safetensors")
Developing
# inside ./safetensors/bindings/python
pip install .[dev]
Should be enough to install this library locally.
Testing
# inside ./safetensors/bindings/python
pip install .[dev]
pytest -sv tests/
Metadata
Release files for safetensors 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| safetensors-0.8.0.tar.gz | 325.8 kB | Details |
Built distributions (wheels)
Total release size: 9.1 MB
Release files / safetensors-0.8.0.tar.gz
| Download URL | safetensors-0.8.0.tar.gz |
|---|---|
| Size | 325.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fabaf3e0f18a6618d9b36560682562157f77c2b71fcffc7b432be2baed9d753d
|
|
BLAKE2b-256 checksum How to use checksums |
4506f955dbbb1859e3bd23c8ac6141af5106e7ad5fedec4a3a6e3d60f94b7001
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.13.3
|
Release files / safetensors-0.8.0-cp310-abi3-win_arm64.whl
| Download URL | safetensors-0.8.0-cp310-abi3-win_arm64.whl |
|---|---|
| Size | 340.5 kB |
| Tags | CPython 3.10 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
f7838e5135a406ad3e02efdcb8cf2e5397d368b0154537c4fec682dbc544d452
|
|
BLAKE2b-256 checksum How to use checksums |
8dfc7eedc3510d97878876e32774eebbeb61c43f148a96e915c84229a3e967aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.13.3
|
Release files / safetensors-0.8.0-cp310-abi3-win_amd64.whl
| Download URL | safetensors-0.8.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 355.5 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
096ec1a98435df7beb08853bb5aa9081a84f23d0adc67ed1a0a10550f608373f
|
|
BLAKE2b-256 checksum How to use checksums |
1b6d3fba214c1e5e0f69991677ec3bc17023f0421776975e1de0c682dca475e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.13.3
|
Release files / safetensors-0.8.0-cp310-abi3-win32.whl
| Download URL | safetensors-0.8.0-cp310-abi3-win32.whl |
|---|---|
| Size | 342.4 kB |
| Tags | CPython 3.10 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
2ddf52eac562eda224f99acfa7889d02968c1fd59a5b011ae7d8137c37e9c02d
|
|
BLAKE2b-256 checksum How to use checksums |
8e3f73ccf82579412b4a71c4ca673f10b5f1f888d7cf5af7fe24f27d30307be4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.13.3
|
Release files / safetensors-0.8.0-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | safetensors-0.8.0-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 722.4 kB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
8e080062fcde23be189565e1c3305d16751a218ecf9412c8601e64204eb6f846
|
|
BLAKE2b-256 checksum How to use checksums |
274341c1621732edd934d868a00d1b891584c892a7b62a9aab82ea5a0a5623ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.13.3
|
Release files / safetensors-0.8.0-cp310-abi3-musllinux_1_2_i686.whl
| Download URL | safetensors-0.8.0-cp310-abi3-musllinux_1_2_i686.whl |
|---|---|
| Size | 765.7 kB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
3ae091f16662658bdc019a4ff6cb4c085bb7d725eb5978b183ffd265863b6d2d
|
|
BLAKE2b-256 checksum How to use checksums |
294b1c19c509d56e01f4fbb3d0a2e597450f6cc04d1d56cf52defb0a62dfd715
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.13.3
|
Release files / safetensors-0.8.0-cp310-abi3-musllinux_1_2_armv7l.whl
| Download URL | safetensors-0.8.0-cp310-abi3-musllinux_1_2_armv7l.whl |
|---|---|
| Size | 786.7 kB |
| Tags | CPython 3.10 Linux musl 1.2+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
4a95ae2b05d7726d751da4ebf626a2ca782b706e101bd894c95bc2450b1cffcc
|
|
BLAKE2b-256 checksum How to use checksums |
72e368cd3fa5b48488e84add63e04cb12f3bc28ae4638c06d4508c6e88823d0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.13.3
|
Release files / safetensors-0.8.0-cp310-abi3-musllinux_1_2_aarch64.whl
| Download URL | safetensors-0.8.0-cp310-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 678.7 kB |
| Tags | CPython 3.10 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
87eec7ffed2b809f05a398a8becb7d013f19f7837cd15d9748580d6cf30dbaf4
|
|
BLAKE2b-256 checksum How to use checksums |
2a43bf38443278eab4b1be1fce2931e2b012ad9cb7df52ada751d0aab8f7659a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.13.3
|
Release files / safetensors-0.8.0-cp310-abi3-manylinux_2_31_riscv64.whl
| Download URL | safetensors-0.8.0-cp310-abi3-manylinux_2_31_riscv64.whl |
|---|---|
| Size | 513.8 kB |
| Tags | CPython 3.10 Linux glibc 2.31+ RISC-V 64 abi3 |
|
SHA-256 checksum How to use checksums |
fcdd41ec4628fee5799f807c73c353629130fbd942aa23d83c623dd6c9d52d78
|
|
BLAKE2b-256 checksum How to use checksums |
46fbcdaed17ceb2948784fd9c36b6fd3e951b608547cea81a48e8ee6f8cfdfcb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.13.3
|
Release files / safetensors-0.8.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | safetensors-0.8.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 516.0 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
fd6f3f93c9a0a7cc2788ee63fb763353d4bd2e89b0751bc78fcf7dda00bea774
|
|
BLAKE2b-256 checksum How to use checksums |
2850f203ff3a3ddfe19308efc83c5a3a29ed02bf786732ec35e68bf9162f3365
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.13.3
|
Release files / safetensors-0.8.0-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
| Download URL | safetensors-0.8.0-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl |
|---|---|
| Size | 545.1 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ IBM System/390x abi3 |
|
SHA-256 checksum How to use checksums |
040070828e36dc8e122178bbbd5830ff9e97920affb84cbe0f46442497bed358
|
|
BLAKE2b-256 checksum How to use checksums |
76228d64d9df2c45d5ded401df889d0ad90882804ca172d79ec4f0df8f727fe0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.13.3
|
Release files / safetensors-0.8.0-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
| Download URL | safetensors-0.8.0-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl |
|---|---|
| Size | 633.5 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ PowerPC 64-le abi3 |
|
SHA-256 checksum How to use checksums |
7bc0a787ba8a35be368ee3574edfa2b1ad389eebd0a72e482ae275490e3f6c98
|
|
BLAKE2b-256 checksum How to use checksums |
2087846c289e7aa2299eff406335717cf43ce8777194ece8aad75772e0411615
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.13.3
|
Release files / safetensors-0.8.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
| Download URL | safetensors-0.8.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl |
|---|---|
| Size | 511.8 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
4124502b78f03534117c848f87a39b8f31e577b15eff423bf8bfb95f2a8c30d0
|
|
BLAKE2b-256 checksum How to use checksums |
914f3175c9d75634e0e0dda0082794193521035edd7c70a6f212bf33ca06ddf4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.13.3
|
Release files / safetensors-0.8.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | safetensors-0.8.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 502.8 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
7a46e5ff292c356d6991e60942ba7f79817682d3a2cef0702136448cb9c4d235
|
|
BLAKE2b-256 checksum How to use checksums |
097d65a7de0af421317bb36a067241e4235fff194eed60b961ed6d3f59a3fc60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.13.3
|
Release files / safetensors-0.8.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl
| Download URL | safetensors-0.8.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl |
|---|---|
| Size | 559.9 kB |
| Tags | CPython 3.10 Linux glibc 2.5+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
8e9f537aa183a38ace122d27303dcd986b26bd2a7591f9181d7f0c396f4677ca
|
|
BLAKE2b-256 checksum How to use checksums |
0d491e15de264dcc3b77943d2d0c56a95809956883b1c2d6d585c792523f180b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.13.3
|
Release files / safetensors-0.8.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | safetensors-0.8.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 484.6 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c80201d22cbf405b80647a60ada77bba06c8fba2da2743ba1e89cdcc39a81f25
|
|
BLAKE2b-256 checksum How to use checksums |
f5b1fa7c600e7dceae12e9606c7578cbc9ff1e1ed55844883ee5c92205e86226
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.13.3
|
Release files / safetensors-0.8.0-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | safetensors-0.8.0-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 473.6 kB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
c554f85858e05226d3c2828e32395e677434685d6d94594a41643361c5e837f0
|
|
BLAKE2b-256 checksum How to use checksums |
39a0f718cda65b05407d228f97602cf60dca269c979867aa5beb25410de26cd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.13.3
|