]> khamidou — GitHub mirrors - safetensors.git/commit
Big revamp: (#10)
authorNicolas Patry <patry.nicolas@protonmail.com>
Thu, 29 Sep 2022 07:34:13 +0000 (09:34 +0200)
committerGitHub <noreply@github.com>
Thu, 29 Sep 2022 07:34:13 +0000 (09:34 +0200)
commit86e356fed6b75d4b0a06ee446ab94f1317eafc2e
tree8d0bc95de970bcb939d0a5c779efe4ae9fa5426b
parentc5c1316c7a7d4a6c5011ce9fde6d330aed9b64cd
Big revamp: (#10)

* Adding slicing support on tensorview.

Clippy 1.64.

Improve the comment.

[WIP] Bad python slice API for now, still looking for a nice pythonesque
one

But at least this works !

Much better API.

Pros:
- handles a lot of boilerplate for caller.
- Feels more pythonesque

Cons:
- Unsure about soundness of keeping Mmap struct.
- Lots more boilerplate in the binding

Removing unused code.

Improved API names hopefully.

Adding .keys() support.

Big revamp:

- Remove `Tensor` to fuse with `TensorView` (the price to pay for shape
  cloning should be small enough that it shouldn't make too much of a
difference
- Remove `deserialize_file`, now that we have `safe_open` facility.
- Tried to remove `torch` dependency on `numpy` (Still need the
  `torch.Tensor` to bytes without copying facility.
- Revamped the speed tests to show metrics side by side. They need
  to be taken with extreme caution, timings are never reproducible.

New possibility to save metadata.

Fixing the workflow.

Rename.

Black.

Installing other libs.

Make windows happy.

Non venv.

Install jax on windows is impossible ?

More private python functions + Windows(flax) shenanigans.

Fixing TF to be ACTUALLY TF native.

Option<Metadata>

* Black.

* Export metadata.
15 files changed:
.github/workflows/python.yml [new file with mode: 0644]
bindings/python/Cargo.toml
bindings/python/py_src/safetensors/__init__.py
bindings/python/py_src/safetensors/flax.py
bindings/python/py_src/safetensors/numpy.py
bindings/python/py_src/safetensors/tensorflow.py
bindings/python/py_src/safetensors/torch.py
bindings/python/src/lib.rs
bindings/python/tests/test_flax_comparison.py
bindings/python/tests/test_pt_comparison.py
bindings/python/tests/test_simple.py
bindings/python/tests/test_tf_comparison.py
safetensors/src/lib.rs
safetensors/src/slice.rs [new file with mode: 0644]
safetensors/src/tensor.rs [new file with mode: 0644]