safetensors 0.4.6.dev0__cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of safetensors might be problematic. Click here for more details.
- safetensors/__init__.py +9 -0
- safetensors/__init__.pyi +73 -0
- safetensors/_safetensors_rust.abi3.so +0 -0
- safetensors/flax.py +138 -0
- safetensors/mlx.py +138 -0
- safetensors/numpy.py +176 -0
- safetensors/paddle.py +138 -0
- safetensors/py.typed +0 -0
- safetensors/tensorflow.py +137 -0
- safetensors/torch.py +503 -0
- safetensors-0.4.6.dev0.dist-info/METADATA +127 -0
- safetensors-0.4.6.dev0.dist-info/RECORD +13 -0
- safetensors-0.4.6.dev0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: safetensors
|
|
3
|
+
Version: 0.4.6.dev0
|
|
4
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: Intended Audience :: Education
|
|
7
|
+
Classifier: Intended Audience :: Science/Research
|
|
8
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
16
|
+
Classifier: Typing :: Typed
|
|
17
|
+
Requires-Dist: numpy >=1.21.6 ; extra == 'numpy'
|
|
18
|
+
Requires-Dist: safetensors[numpy] ; extra == 'torch'
|
|
19
|
+
Requires-Dist: torch >=1.10 ; extra == 'torch'
|
|
20
|
+
Requires-Dist: safetensors[numpy] ; extra == 'tensorflow'
|
|
21
|
+
Requires-Dist: tensorflow >=2.11.0 ; extra == 'tensorflow'
|
|
22
|
+
Requires-Dist: safetensors[numpy] ; extra == 'pinned-tf'
|
|
23
|
+
Requires-Dist: tensorflow ==2.18.0 ; extra == 'pinned-tf'
|
|
24
|
+
Requires-Dist: safetensors[numpy] ; extra == 'jax'
|
|
25
|
+
Requires-Dist: flax >=0.6.3 ; extra == 'jax'
|
|
26
|
+
Requires-Dist: jax >=0.3.25 ; extra == 'jax'
|
|
27
|
+
Requires-Dist: jaxlib >=0.3.25 ; extra == 'jax'
|
|
28
|
+
Requires-Dist: mlx >=0.0.9 ; extra == 'mlx'
|
|
29
|
+
Requires-Dist: safetensors[numpy] ; extra == 'paddlepaddle'
|
|
30
|
+
Requires-Dist: paddlepaddle >=2.4.1 ; extra == 'paddlepaddle'
|
|
31
|
+
Requires-Dist: black ==22.3 ; extra == 'quality'
|
|
32
|
+
Requires-Dist: click ==8.0.4 ; extra == 'quality'
|
|
33
|
+
Requires-Dist: isort >=5.5.4 ; extra == 'quality'
|
|
34
|
+
Requires-Dist: flake8 >=3.8.3 ; extra == 'quality'
|
|
35
|
+
Requires-Dist: safetensors[numpy] ; extra == 'testing'
|
|
36
|
+
Requires-Dist: h5py >=3.7.0 ; extra == 'testing'
|
|
37
|
+
Requires-Dist: huggingface-hub >=0.12.1 ; extra == 'testing'
|
|
38
|
+
Requires-Dist: setuptools-rust >=1.5.2 ; extra == 'testing'
|
|
39
|
+
Requires-Dist: pytest >=7.2.0 ; extra == 'testing'
|
|
40
|
+
Requires-Dist: pytest-benchmark >=4.0.0 ; extra == 'testing'
|
|
41
|
+
Requires-Dist: hypothesis >=6.70.2 ; extra == 'testing'
|
|
42
|
+
Requires-Dist: safetensors[torch] ; extra == 'all'
|
|
43
|
+
Requires-Dist: safetensors[numpy] ; extra == 'all'
|
|
44
|
+
Requires-Dist: safetensors[pinned-tf] ; extra == 'all'
|
|
45
|
+
Requires-Dist: safetensors[jax] ; extra == 'all'
|
|
46
|
+
Requires-Dist: safetensors[paddlepaddle] ; extra == 'all'
|
|
47
|
+
Requires-Dist: safetensors[quality] ; extra == 'all'
|
|
48
|
+
Requires-Dist: safetensors[testing] ; extra == 'all'
|
|
49
|
+
Requires-Dist: safetensors[all] ; extra == 'dev'
|
|
50
|
+
Provides-Extra: numpy
|
|
51
|
+
Provides-Extra: torch
|
|
52
|
+
Provides-Extra: tensorflow
|
|
53
|
+
Provides-Extra: pinned-tf
|
|
54
|
+
Provides-Extra: jax
|
|
55
|
+
Provides-Extra: mlx
|
|
56
|
+
Provides-Extra: paddlepaddle
|
|
57
|
+
Provides-Extra: quality
|
|
58
|
+
Provides-Extra: testing
|
|
59
|
+
Provides-Extra: all
|
|
60
|
+
Provides-Extra: dev
|
|
61
|
+
Author-email: Nicolas Patry <patry.nicolas@protonmail.com>
|
|
62
|
+
Requires-Python: >=3.7
|
|
63
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
64
|
+
Project-URL: Homepage, https://github.com/huggingface/safetensors
|
|
65
|
+
Project-URL: Source, https://github.com/huggingface/safetensors
|
|
66
|
+
|
|
67
|
+
## Installation
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
pip install safetensors
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
75
|
+
|
|
76
|
+
### Numpy
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
from safetensors.numpy import save_file, load_file
|
|
80
|
+
import numpy as np
|
|
81
|
+
|
|
82
|
+
tensors = {
|
|
83
|
+
"a": np.zeros((2, 2)),
|
|
84
|
+
"b": np.zeros((2, 3), dtype=np.uint8)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
save_file(tensors, "./model.safetensors")
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# Now loading
|
|
91
|
+
loaded = load_file("./model.safetensors")
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Torch
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
from safetensors.torch import save_file, load_file
|
|
98
|
+
import torch
|
|
99
|
+
|
|
100
|
+
tensors = {
|
|
101
|
+
"a": torch.zeros((2, 2)),
|
|
102
|
+
"b": torch.zeros((2, 3), dtype=torch.uint8)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
save_file(tensors, "./model.safetensors")
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
# Now loading
|
|
109
|
+
loaded = load_file("./model.safetensors")
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Developing
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
# inside ./safetensors/bindings/python
|
|
116
|
+
pip install .[dev]
|
|
117
|
+
```
|
|
118
|
+
Should be enough to install this library locally.
|
|
119
|
+
|
|
120
|
+
### Testing
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
# inside ./safetensors/bindings/python
|
|
124
|
+
pip install .[dev]
|
|
125
|
+
pytest -sv tests/
|
|
126
|
+
```
|
|
127
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
safetensors-0.4.6.dev0.dist-info/METADATA,sha256=oFqgiOOkI6mNv_UNo3RwgkTHVcKQoimSR5vB6DKkPeQ,3847
|
|
2
|
+
safetensors-0.4.6.dev0.dist-info/WHEEL,sha256=t3KKBTEj_y9d8npJLBBAjdwHuWGzJ560Amrhtyb5sTo,127
|
|
3
|
+
safetensors/torch.py,sha256=qVvpJJkNmb1FaW9Gj1DllGgqfA1wlDqQRn5DyEIWo90,17822
|
|
4
|
+
safetensors/tensorflow.py,sha256=6XaUBcxm0xL4ulNcvVsllKZ_qJ_rBSlE50rNnECCNYQ,3890
|
|
5
|
+
safetensors/flax.py,sha256=AuyY2YHxTBy4xeQLxhAyMledHykpz0Qsys13eKiHNYg,3846
|
|
6
|
+
safetensors/__init__.py,sha256=rFhZV2HBVDIijU2xKjg-0viTLETa-yMLMgFC9-47hdc,171
|
|
7
|
+
safetensors/paddle.py,sha256=V_RCTXymi2PJAG_jA4-qnfzbYAUB_74VYYXFzhXTLYM,4175
|
|
8
|
+
safetensors/mlx.py,sha256=7OTFtbdmGIqLnrjo_36RJRJ7zq1aI6HasvRPLB3d_Gw,3837
|
|
9
|
+
safetensors/numpy.py,sha256=5Z_wSFRxVbsAXpnej2zuqtdYK9K-nqZs1EE_G14C6Ck,4937
|
|
10
|
+
safetensors/__init__.pyi,sha256=Pb-zYcow6B_p6ZUAyDIx3seq9cf6oKGD6EzQ6vTaSBE,1971
|
|
11
|
+
safetensors/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
+
safetensors/_safetensors_rust.abi3.so,sha256=U5GjE0jzYholK11ytZMyC0AC-Ff1EBCoF00js4S7ZzU,1026220
|
|
13
|
+
safetensors-0.4.6.dev0.dist-info/RECORD,,
|