This release is a pre-release and may not be stable for production use.
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
pip install setuptools_rust
python setup.py develop
Should be enough to install this library locally.
Testing
pip install pytest # We don't require pytest, but it's a common library used across HF.
pytest -sv tests/
Metadata
Release files for safetensors 0.2.1.dev0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| safetensors-0.2.1.dev0.tar.gz | 4.6 kB | Without provenance | Details |
Built distributions (wheels)
Total release size: 8.7 MB
Release files / safetensors-0.2.1.dev0.tar.gz
| Download URL | safetensors-0.2.1.dev0.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f48c3a97e73f973986e007e65700b864a0aee8b606225b1a0cb16a264d0e56b
|
|
BLAKE2b-256 checksum How to use checksums |
a32c848172cc3c72e975972d859c01b6f3247f65b5f0a402356c6962fe942575
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp310-cp310-win_amd64.whl
| Download URL | safetensors-0.2.1.dev0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 236.7 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a6bc556b6aa09727df167a80f5727520e4c062d59ea38eab1296f2f8d32a9cfd
|
|
BLAKE2b-256 checksum How to use checksums |
175526a8e0be04f0b6d6b0cd103f5b361917db9e0ff88ef8ac5c65e40db2e1ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp310-cp310-win32.whl
| Download URL | safetensors-0.2.1.dev0-cp310-cp310-win32.whl |
|---|---|
| Size | 228.4 kB |
| Tags | CPython 3.10 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
e7778c79e06071ba278a3a8b07341a05701041df6e579bbe863d6326d0966812
|
|
BLAKE2b-256 checksum How to use checksums |
7a223011d644f7e88836254f8428d143f647e6064377309937536b7be5a8a4fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | safetensors-0.2.1.dev0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
241d87371048033f4f1e04651560ecd345485e94cedd449fc6474456b2454783
|
|
BLAKE2b-256 checksum How to use checksums |
081061f408fc43fc05c967a2921d59437af763c5ebb8a0ec73d572c9a974bff3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp310-cp310-macosx_12_0_arm64.whl
| Download URL | safetensors-0.2.1.dev0-cp310-cp310-macosx_12_0_arm64.whl |
|---|---|
| Size | 345.1 kB |
| Tags | CPython 3.10 macOS 12.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3daedffbc39fad49ed0f4de9937737bb01cd726d4c2a6fc67715a6cf12f67f96
|
|
BLAKE2b-256 checksum How to use checksums |
784ddcf932ce6c01ba310213dc808731b52f0c45131dea4f010498d224f7df86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp310-cp310-macosx_10_11_x86_64.whl
| Download URL | safetensors-0.2.1.dev0-cp310-cp310-macosx_10_11_x86_64.whl |
|---|---|
| Size | 360.2 kB |
| Tags | CPython 3.10 macOS 10.11+ x86-64 |
|
SHA-256 checksum How to use checksums |
4c9e9b755e84f3c58b915e5c1588eaab69b2ed1e9db5ed3a4016f85a689880d0
|
|
BLAKE2b-256 checksum How to use checksums |
b4d84a697020d32d7069bf60df58f3d1be5ab7cbc70c2535cdc6c91cc2a79922
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp39-cp39-win_amd64.whl
| Download URL | safetensors-0.2.1.dev0-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 237.1 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6461670870b770da4ba343aee709622984889437f8f236dadbcc6ecaa78eb1e5
|
|
BLAKE2b-256 checksum How to use checksums |
c87986c4f078ce46c42b64393e1ef3df4892cb7554aaa5786e9fd48c3a7247dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp39-cp39-win32.whl
| Download URL | safetensors-0.2.1.dev0-cp39-cp39-win32.whl |
|---|---|
| Size | 228.6 kB |
| Tags | CPython 3.9 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
49c3950b683894b0b7f1e4fc764d92d5402a415626a0133479ea373f52c89f88
|
|
BLAKE2b-256 checksum How to use checksums |
f23b7b59a25d47121f4f2a46a023d6cb1352bc9ccf0731eb833a90dbadfdcd6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | safetensors-0.2.1.dev0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
d7565fb64d546cf1750e88875e8e0d5337760bdfa5bafbc2be8e61d205cf7d81
|
|
BLAKE2b-256 checksum How to use checksums |
4b6587fe7b37dbeb8efeffd0bca7f7c0f3e3649dc6c406f9bf2b3d715c0788b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp39-cp39-macosx_12_0_arm64.whl
| Download URL | safetensors-0.2.1.dev0-cp39-cp39-macosx_12_0_arm64.whl |
|---|---|
| Size | 345.6 kB |
| Tags | CPython 3.9 macOS 12.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d185cfaa0b342abfb6b4c9160d1e60ef174a9f3d27bc292cc2963469503e254a
|
|
BLAKE2b-256 checksum How to use checksums |
2309165dc5decfb7b18ff53f46f495e0807e71b51b47c5a833b7849ba80ffa3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp39-cp39-macosx_10_11_x86_64.whl
| Download URL | safetensors-0.2.1.dev0-cp39-cp39-macosx_10_11_x86_64.whl |
|---|---|
| Size | 360.7 kB |
| Tags | CPython 3.9 macOS 10.11+ x86-64 |
|
SHA-256 checksum How to use checksums |
61a3940a16e0c6d79d55fa9fd865c963aa45b83d919e88dc9de23c699d382175
|
|
BLAKE2b-256 checksum How to use checksums |
a3dfc485255951c3c411c19d9bfc4082664c66a11a01415cec4bec8a471a202f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp38-cp38-win_amd64.whl
| Download URL | safetensors-0.2.1.dev0-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 237.1 kB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6a15fd1323b128bb6535f6ab65968510a96cfa2f28510dff551a9f640135da44
|
|
BLAKE2b-256 checksum How to use checksums |
7836b4eaebe75156b353b5e226586a8b56ca3777ab1a35692254c4c67bb194ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp38-cp38-win32.whl
| Download URL | safetensors-0.2.1.dev0-cp38-cp38-win32.whl |
|---|---|
| Size | 228.5 kB |
| Tags | CPython 3.8 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
a87f39995341bff20e91e0be4100b390e142c7d5371884958fb0159671ddb20e
|
|
BLAKE2b-256 checksum How to use checksums |
0569dc524f5fae089188fe9a976aaadbf5f562b1b4f9c6273437e72b81f3e115
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | safetensors-0.2.1.dev0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
1c62d77fe8fe4c6ac1ecfefa68f5f585fdd96dbd4597e6849178c33d35c94dd0
|
|
BLAKE2b-256 checksum How to use checksums |
4deb9d6f9ffb25f8288b812fefbbf8a7a9459a4dda3308e61b95eb7ba1efa52f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp38-cp38-macosx_10_11_x86_64.whl
| Download URL | safetensors-0.2.1.dev0-cp38-cp38-macosx_10_11_x86_64.whl |
|---|---|
| Size | 360.8 kB |
| Tags | CPython 3.8 macOS 10.11+ x86-64 |
|
SHA-256 checksum How to use checksums |
3a2a93857b4aae88568dfe6cb562b5bbe17d1f5d0f43a41aaef357dcff5b8ecd
|
|
BLAKE2b-256 checksum How to use checksums |
3ccb4fcb8d22467e6da61233fce57f679cafe84bbf9260846d9854a082208d32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp37-cp37m-win_amd64.whl
| Download URL | safetensors-0.2.1.dev0-cp37-cp37m-win_amd64.whl |
|---|---|
| Size | 237.1 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f0a3e10c9338e7c336a08af369d079d66d7224b2e6a09fa4394cbe3635932d00
|
|
BLAKE2b-256 checksum How to use checksums |
d177dbc3fd144a43981931b291b91559fd0ea6723ebd053ac72f9b71228a612a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp37-cp37m-win32.whl
| Download URL | safetensors-0.2.1.dev0-cp37-cp37m-win32.whl |
|---|---|
| Size | 228.5 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
4e9e5dcb9fc0dcf55ac9b5a36f951dc8472eb47828c8885191cab16d5767db08
|
|
BLAKE2b-256 checksum How to use checksums |
f5eaa2a86b26035a01500617ba1e5454a48703668c9eb8d65877d05da94ae6e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | safetensors-0.2.1.dev0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
5886d5b1baace98eaa1979636e2c997587020f4417822144aa8ff0fa17e307b6
|
|
BLAKE2b-256 checksum How to use checksums |
b03d433a0cc706118dcad73d68803c4919e627bddfa38689a27dee5f404833b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / safetensors-0.2.1.dev0-cp37-cp37m-macosx_10_11_x86_64.whl
| Download URL | safetensors-0.2.1.dev0-cp37-cp37m-macosx_10_11_x86_64.whl |
|---|---|
| Size | 360.8 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc macOS 10.11+ x86-64 |
|
SHA-256 checksum How to use checksums |
27ad6120f37dd9fee9cd135a45e81528ec17e93d1b91d08987a364f0862d8332
|
|
BLAKE2b-256 checksum How to use checksums |
60adbd99d552dc70baa665683dd8b92917ae939c8fc2e68eb4ac52bce34ac386
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Security for safetensors 0.2.1.dev0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.