safetensors 0.5.2__tar.gz → 0.6.0.dev0__tar.gz
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-0.5.2 → safetensors-0.6.0.dev0}/PKG-INFO +22 -21
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/Cargo.lock +45 -52
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/Cargo.toml +3 -2
- safetensors-0.6.0.dev0/bindings/python/LICENSE +201 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0/bindings/python}/py_src/safetensors/__init__.pyi +3 -3
- {safetensors-0.5.2 → safetensors-0.6.0.dev0/bindings/python}/py_src/safetensors/flax.py +1 -1
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/py_src/safetensors/mlx.py +1 -1
- {safetensors-0.5.2 → safetensors-0.6.0.dev0/bindings/python}/py_src/safetensors/numpy.py +1 -1
- {safetensors-0.5.2 → safetensors-0.6.0.dev0/bindings/python}/py_src/safetensors/tensorflow.py +1 -1
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/py_src/safetensors/torch.py +66 -11
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/src/lib.rs +169 -76
- safetensors-0.6.0.dev0/bindings/python/src/view.rs +143 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/tests/test_flax_comparison.py +9 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/tests/test_pt_comparison.py +66 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/tests/test_simple.py +34 -15
- safetensors-0.6.0.dev0/bindings/python/uv.lock +2568 -0
- {safetensors-0.5.2/bindings/python → safetensors-0.6.0.dev0}/py_src/safetensors/__init__.pyi +3 -3
- {safetensors-0.5.2/bindings/python → safetensors-0.6.0.dev0}/py_src/safetensors/flax.py +1 -1
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/py_src/safetensors/mlx.py +1 -1
- {safetensors-0.5.2/bindings/python → safetensors-0.6.0.dev0}/py_src/safetensors/numpy.py +1 -1
- {safetensors-0.5.2/bindings/python → safetensors-0.6.0.dev0}/py_src/safetensors/tensorflow.py +1 -1
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/py_src/safetensors/torch.py +66 -11
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/pyproject.toml +2 -2
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/safetensors/Cargo.toml +5 -4
- safetensors-0.6.0.dev0/safetensors/LICENSE +201 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/safetensors/README.md +2 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/safetensors/benches/benchmark.rs +9 -6
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/safetensors/src/slice.rs +160 -17
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/safetensors/src/tensor.rs +370 -144
- {safetensors-0.5.2/safetensors → safetensors-0.6.0.dev0}/LICENSE +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/.gitignore +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/MANIFEST.in +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/Makefile +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/README.md +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/benches/test_flax.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/benches/test_mlx.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/benches/test_paddle.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/benches/test_pt.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/benches/test_tf.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/convert.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/convert_all.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/fuzz.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/py_src/safetensors/__init__.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/py_src/safetensors/paddle.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/py_src/safetensors/py.typed +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/setup.cfg +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/stub.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/tests/data/__init__.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/tests/test_mlx_comparison.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/tests/test_paddle_comparison.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/tests/test_pt_model.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/bindings/python/tests/test_tf_comparison.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/py_src/safetensors/__init__.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/py_src/safetensors/paddle.py +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/py_src/safetensors/py.typed +0 -0
- {safetensors-0.5.2 → safetensors-0.6.0.dev0}/safetensors/src/lib.rs +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: safetensors
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0.dev0
|
|
4
4
|
Classifier: Development Status :: 5 - Production/Stable
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: Intended Audience :: Education
|
|
@@ -14,31 +14,31 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
15
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
16
16
|
Classifier: Typing :: Typed
|
|
17
|
-
Requires-Dist: numpy
|
|
17
|
+
Requires-Dist: numpy>=1.21.6 ; extra == 'numpy'
|
|
18
18
|
Requires-Dist: safetensors[numpy] ; extra == 'torch'
|
|
19
|
-
Requires-Dist: torch
|
|
19
|
+
Requires-Dist: torch>=1.10 ; extra == 'torch'
|
|
20
20
|
Requires-Dist: safetensors[numpy] ; extra == 'tensorflow'
|
|
21
|
-
Requires-Dist: tensorflow
|
|
21
|
+
Requires-Dist: tensorflow>=2.11.0 ; extra == 'tensorflow'
|
|
22
22
|
Requires-Dist: safetensors[numpy] ; extra == 'pinned-tf'
|
|
23
|
-
Requires-Dist: tensorflow
|
|
23
|
+
Requires-Dist: tensorflow==2.18.0 ; extra == 'pinned-tf'
|
|
24
24
|
Requires-Dist: safetensors[numpy] ; extra == 'jax'
|
|
25
|
-
Requires-Dist: flax
|
|
26
|
-
Requires-Dist: jax
|
|
27
|
-
Requires-Dist: jaxlib
|
|
28
|
-
Requires-Dist: mlx
|
|
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
29
|
Requires-Dist: safetensors[numpy] ; extra == 'paddlepaddle'
|
|
30
|
-
Requires-Dist: paddlepaddle
|
|
31
|
-
Requires-Dist: black
|
|
32
|
-
Requires-Dist: click
|
|
33
|
-
Requires-Dist: isort
|
|
34
|
-
Requires-Dist: flake8
|
|
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
35
|
Requires-Dist: safetensors[numpy] ; extra == 'testing'
|
|
36
|
-
Requires-Dist: h5py
|
|
37
|
-
Requires-Dist: huggingface-hub
|
|
38
|
-
Requires-Dist: setuptools-rust
|
|
39
|
-
Requires-Dist: pytest
|
|
40
|
-
Requires-Dist: pytest-benchmark
|
|
41
|
-
Requires-Dist: hypothesis
|
|
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
42
|
Requires-Dist: safetensors[torch] ; extra == 'all'
|
|
43
43
|
Requires-Dist: safetensors[numpy] ; extra == 'all'
|
|
44
44
|
Requires-Dist: safetensors[pinned-tf] ; extra == 'all'
|
|
@@ -58,8 +58,9 @@ Provides-Extra: quality
|
|
|
58
58
|
Provides-Extra: testing
|
|
59
59
|
Provides-Extra: all
|
|
60
60
|
Provides-Extra: dev
|
|
61
|
+
License-File: LICENSE
|
|
61
62
|
Author-email: Nicolas Patry <patry.nicolas@protonmail.com>
|
|
62
|
-
Requires-Python: >=3.
|
|
63
|
+
Requires-Python: >=3.9
|
|
63
64
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
64
65
|
Project-URL: Homepage, https://github.com/huggingface/safetensors
|
|
65
66
|
Project-URL: Source, https://github.com/huggingface/safetensors
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This file is automatically @generated by Cargo.
|
|
2
2
|
# It is not intended for manual editing.
|
|
3
|
-
version =
|
|
3
|
+
version = 3
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
6
6
|
name = "autocfg"
|
|
@@ -8,12 +8,6 @@ version = "1.4.0"
|
|
|
8
8
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
9
|
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
|
|
10
10
|
|
|
11
|
-
[[package]]
|
|
12
|
-
name = "cfg-if"
|
|
13
|
-
version = "1.0.0"
|
|
14
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
-
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|
16
|
-
|
|
17
11
|
[[package]]
|
|
18
12
|
name = "heck"
|
|
19
13
|
version = "0.5.0"
|
|
@@ -22,27 +16,27 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
|
22
16
|
|
|
23
17
|
[[package]]
|
|
24
18
|
name = "indoc"
|
|
25
|
-
version = "2.0.
|
|
19
|
+
version = "2.0.6"
|
|
26
20
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
27
|
-
checksum = "
|
|
21
|
+
checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd"
|
|
28
22
|
|
|
29
23
|
[[package]]
|
|
30
24
|
name = "itoa"
|
|
31
|
-
version = "1.0.
|
|
25
|
+
version = "1.0.15"
|
|
32
26
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
33
|
-
checksum = "
|
|
27
|
+
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
|
|
34
28
|
|
|
35
29
|
[[package]]
|
|
36
30
|
name = "libc"
|
|
37
|
-
version = "0.2.
|
|
31
|
+
version = "0.2.173"
|
|
38
32
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
39
|
-
checksum = "
|
|
33
|
+
checksum = "d8cfeafaffdbc32176b64fb251369d52ea9f0a8fbc6f8759edffef7b525d64bb"
|
|
40
34
|
|
|
41
35
|
[[package]]
|
|
42
36
|
name = "memchr"
|
|
43
|
-
version = "2.7.
|
|
37
|
+
version = "2.7.5"
|
|
44
38
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
45
|
-
checksum = "
|
|
39
|
+
checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
|
|
46
40
|
|
|
47
41
|
[[package]]
|
|
48
42
|
name = "memmap2"
|
|
@@ -64,32 +58,31 @@ dependencies = [
|
|
|
64
58
|
|
|
65
59
|
[[package]]
|
|
66
60
|
name = "once_cell"
|
|
67
|
-
version = "1.
|
|
61
|
+
version = "1.21.3"
|
|
68
62
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
69
|
-
checksum = "
|
|
63
|
+
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
|
|
70
64
|
|
|
71
65
|
[[package]]
|
|
72
66
|
name = "portable-atomic"
|
|
73
|
-
version = "1.
|
|
67
|
+
version = "1.11.1"
|
|
74
68
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
75
|
-
checksum = "
|
|
69
|
+
checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483"
|
|
76
70
|
|
|
77
71
|
[[package]]
|
|
78
72
|
name = "proc-macro2"
|
|
79
|
-
version = "1.0.
|
|
73
|
+
version = "1.0.95"
|
|
80
74
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
81
|
-
checksum = "
|
|
75
|
+
checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
|
|
82
76
|
dependencies = [
|
|
83
77
|
"unicode-ident",
|
|
84
78
|
]
|
|
85
79
|
|
|
86
80
|
[[package]]
|
|
87
81
|
name = "pyo3"
|
|
88
|
-
version = "0.
|
|
82
|
+
version = "0.25.1"
|
|
89
83
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
90
|
-
checksum = "
|
|
84
|
+
checksum = "8970a78afe0628a3e3430376fc5fd76b6b45c4d43360ffd6cdd40bdde72b682a"
|
|
91
85
|
dependencies = [
|
|
92
|
-
"cfg-if",
|
|
93
86
|
"indoc",
|
|
94
87
|
"libc",
|
|
95
88
|
"memoffset",
|
|
@@ -103,9 +96,9 @@ dependencies = [
|
|
|
103
96
|
|
|
104
97
|
[[package]]
|
|
105
98
|
name = "pyo3-build-config"
|
|
106
|
-
version = "0.
|
|
99
|
+
version = "0.25.1"
|
|
107
100
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
108
|
-
checksum = "
|
|
101
|
+
checksum = "458eb0c55e7ece017adeba38f2248ff3ac615e53660d7c71a238d7d2a01c7598"
|
|
109
102
|
dependencies = [
|
|
110
103
|
"once_cell",
|
|
111
104
|
"target-lexicon",
|
|
@@ -113,9 +106,9 @@ dependencies = [
|
|
|
113
106
|
|
|
114
107
|
[[package]]
|
|
115
108
|
name = "pyo3-ffi"
|
|
116
|
-
version = "0.
|
|
109
|
+
version = "0.25.1"
|
|
117
110
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
118
|
-
checksum = "
|
|
111
|
+
checksum = "7114fe5457c61b276ab77c5055f206295b812608083644a5c5b2640c3102565c"
|
|
119
112
|
dependencies = [
|
|
120
113
|
"libc",
|
|
121
114
|
"pyo3-build-config",
|
|
@@ -123,9 +116,9 @@ dependencies = [
|
|
|
123
116
|
|
|
124
117
|
[[package]]
|
|
125
118
|
name = "pyo3-macros"
|
|
126
|
-
version = "0.
|
|
119
|
+
version = "0.25.1"
|
|
127
120
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
128
|
-
checksum = "
|
|
121
|
+
checksum = "a8725c0a622b374d6cb051d11a0983786448f7785336139c3c94f5aa6bef7e50"
|
|
129
122
|
dependencies = [
|
|
130
123
|
"proc-macro2",
|
|
131
124
|
"pyo3-macros-backend",
|
|
@@ -135,9 +128,9 @@ dependencies = [
|
|
|
135
128
|
|
|
136
129
|
[[package]]
|
|
137
130
|
name = "pyo3-macros-backend"
|
|
138
|
-
version = "0.
|
|
131
|
+
version = "0.25.1"
|
|
139
132
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
140
|
-
checksum = "
|
|
133
|
+
checksum = "4109984c22491085343c05b0dbc54ddc405c3cf7b4374fc533f5c3313a572ccc"
|
|
141
134
|
dependencies = [
|
|
142
135
|
"heck",
|
|
143
136
|
"proc-macro2",
|
|
@@ -148,22 +141,22 @@ dependencies = [
|
|
|
148
141
|
|
|
149
142
|
[[package]]
|
|
150
143
|
name = "quote"
|
|
151
|
-
version = "1.0.
|
|
144
|
+
version = "1.0.40"
|
|
152
145
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
153
|
-
checksum = "
|
|
146
|
+
checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
|
|
154
147
|
dependencies = [
|
|
155
148
|
"proc-macro2",
|
|
156
149
|
]
|
|
157
150
|
|
|
158
151
|
[[package]]
|
|
159
152
|
name = "ryu"
|
|
160
|
-
version = "1.0.
|
|
153
|
+
version = "1.0.20"
|
|
161
154
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
162
|
-
checksum = "
|
|
155
|
+
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
|
|
163
156
|
|
|
164
157
|
[[package]]
|
|
165
158
|
name = "safetensors"
|
|
166
|
-
version = "0.
|
|
159
|
+
version = "0.6.0-dev.0"
|
|
167
160
|
dependencies = [
|
|
168
161
|
"serde",
|
|
169
162
|
"serde_json",
|
|
@@ -171,7 +164,7 @@ dependencies = [
|
|
|
171
164
|
|
|
172
165
|
[[package]]
|
|
173
166
|
name = "safetensors-python"
|
|
174
|
-
version = "0.
|
|
167
|
+
version = "0.6.0-dev.0"
|
|
175
168
|
dependencies = [
|
|
176
169
|
"memmap2",
|
|
177
170
|
"pyo3",
|
|
@@ -181,18 +174,18 @@ dependencies = [
|
|
|
181
174
|
|
|
182
175
|
[[package]]
|
|
183
176
|
name = "serde"
|
|
184
|
-
version = "1.0.
|
|
177
|
+
version = "1.0.219"
|
|
185
178
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
186
|
-
checksum = "
|
|
179
|
+
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
|
|
187
180
|
dependencies = [
|
|
188
181
|
"serde_derive",
|
|
189
182
|
]
|
|
190
183
|
|
|
191
184
|
[[package]]
|
|
192
185
|
name = "serde_derive"
|
|
193
|
-
version = "1.0.
|
|
186
|
+
version = "1.0.219"
|
|
194
187
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
195
|
-
checksum = "
|
|
188
|
+
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
|
|
196
189
|
dependencies = [
|
|
197
190
|
"proc-macro2",
|
|
198
191
|
"quote",
|
|
@@ -201,9 +194,9 @@ dependencies = [
|
|
|
201
194
|
|
|
202
195
|
[[package]]
|
|
203
196
|
name = "serde_json"
|
|
204
|
-
version = "1.0.
|
|
197
|
+
version = "1.0.140"
|
|
205
198
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
206
|
-
checksum = "
|
|
199
|
+
checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
|
|
207
200
|
dependencies = [
|
|
208
201
|
"itoa",
|
|
209
202
|
"memchr",
|
|
@@ -213,9 +206,9 @@ dependencies = [
|
|
|
213
206
|
|
|
214
207
|
[[package]]
|
|
215
208
|
name = "syn"
|
|
216
|
-
version = "2.0.
|
|
209
|
+
version = "2.0.103"
|
|
217
210
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
218
|
-
checksum = "
|
|
211
|
+
checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8"
|
|
219
212
|
dependencies = [
|
|
220
213
|
"proc-macro2",
|
|
221
214
|
"quote",
|
|
@@ -224,18 +217,18 @@ dependencies = [
|
|
|
224
217
|
|
|
225
218
|
[[package]]
|
|
226
219
|
name = "target-lexicon"
|
|
227
|
-
version = "0.
|
|
220
|
+
version = "0.13.2"
|
|
228
221
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
229
|
-
checksum = "
|
|
222
|
+
checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a"
|
|
230
223
|
|
|
231
224
|
[[package]]
|
|
232
225
|
name = "unicode-ident"
|
|
233
|
-
version = "1.0.
|
|
226
|
+
version = "1.0.18"
|
|
234
227
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
235
|
-
checksum = "
|
|
228
|
+
checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
|
|
236
229
|
|
|
237
230
|
[[package]]
|
|
238
231
|
name = "unindent"
|
|
239
|
-
version = "0.2.
|
|
232
|
+
version = "0.2.4"
|
|
240
233
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
241
|
-
checksum = "
|
|
234
|
+
checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "safetensors-python"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.6.0-dev.0"
|
|
4
4
|
edition = "2021"
|
|
5
|
+
rust-version = "1.74"
|
|
5
6
|
|
|
6
7
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
7
8
|
[lib]
|
|
@@ -9,7 +10,7 @@ name = "safetensors_rust"
|
|
|
9
10
|
crate-type = ["cdylib"]
|
|
10
11
|
|
|
11
12
|
[dependencies]
|
|
12
|
-
pyo3 = { version = "0.
|
|
13
|
+
pyo3 = { version = "0.25", features = ["abi3", "abi3-py38"] }
|
|
13
14
|
memmap2 = "0.9"
|
|
14
15
|
serde_json = "1.0"
|
|
15
16
|
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
{safetensors-0.5.2 → safetensors-0.6.0.dev0/bindings/python}/py_src/safetensors/__init__.pyi
RENAMED
|
@@ -36,7 +36,7 @@ def serialize(tensor_dict, metadata=None):
|
|
|
36
36
|
@staticmethod
|
|
37
37
|
def serialize_file(tensor_dict, filename, metadata=None):
|
|
38
38
|
"""
|
|
39
|
-
Serializes raw data.
|
|
39
|
+
Serializes raw data into file.
|
|
40
40
|
|
|
41
41
|
Args:
|
|
42
42
|
tensor_dict (`Dict[str, Dict[Any]]`):
|
|
@@ -48,8 +48,8 @@ def serialize_file(tensor_dict, filename, metadata=None):
|
|
|
48
48
|
The optional purely text annotations
|
|
49
49
|
|
|
50
50
|
Returns:
|
|
51
|
-
(`
|
|
52
|
-
|
|
51
|
+
(`NoneType`):
|
|
52
|
+
On success return None.
|
|
53
53
|
"""
|
|
54
54
|
pass
|
|
55
55
|
|
|
@@ -121,7 +121,7 @@ def load_file(filename: Union[str, os.PathLike]) -> Dict[str, Array]:
|
|
|
121
121
|
"""
|
|
122
122
|
result = {}
|
|
123
123
|
with safe_open(filename, framework="flax") as f:
|
|
124
|
-
for k in f.
|
|
124
|
+
for k in f.offset_keys():
|
|
125
125
|
result[k] = f.get_tensor(k)
|
|
126
126
|
return result
|
|
127
127
|
|
|
@@ -120,7 +120,7 @@ def load_file(filename: Union[str, os.PathLike]) -> Dict[str, mx.array]:
|
|
|
120
120
|
"""
|
|
121
121
|
result = {}
|
|
122
122
|
with safe_open(filename, framework="mlx") as f:
|
|
123
|
-
for k in f.
|
|
123
|
+
for k in f.offset_keys():
|
|
124
124
|
result[k] = f.get_tensor(k)
|
|
125
125
|
return result
|
|
126
126
|
|
|
@@ -126,7 +126,7 @@ def load_file(filename: Union[str, os.PathLike]) -> Dict[str, np.ndarray]:
|
|
|
126
126
|
"""
|
|
127
127
|
result = {}
|
|
128
128
|
with safe_open(filename, framework="np") as f:
|
|
129
|
-
for k in f.
|
|
129
|
+
for k in f.offset_keys():
|
|
130
130
|
result[k] = f.get_tensor(k)
|
|
131
131
|
return result
|
|
132
132
|
|
{safetensors-0.5.2 → safetensors-0.6.0.dev0/bindings/python}/py_src/safetensors/tensorflow.py
RENAMED
|
@@ -120,7 +120,7 @@ def load_file(filename: Union[str, os.PathLike]) -> Dict[str, tf.Tensor]:
|
|
|
120
120
|
"""
|
|
121
121
|
result = {}
|
|
122
122
|
with safe_open(filename, framework="tf") as f:
|
|
123
|
-
for k in f.
|
|
123
|
+
for k in f.offset_keys():
|
|
124
124
|
result[k] = f.get_tensor(k)
|
|
125
125
|
return result
|
|
126
126
|
|