]> khamidou — GitHub mirrors - safetensors.git/commit
Return error on out of range index (#565)
authorOliver Ford <ojford@gmail.com>
Tue, 4 Feb 2025 10:31:44 +0000 (10:31 +0000)
committerGitHub <noreply@github.com>
Tue, 4 Feb 2025 10:31:44 +0000 (11:31 +0100)
commitfa833511664338bfc927fc02653ddb7d38d40be9
treee5fc361ae939022062bd14188165d6feb2696875
parent581f43bf212a32aaf00021efbea7fca49620811b
Return error on out of range index (#565)

* Return error on out of range index

Fix issue #560, return a SliceOutOfRange error if the stop value
exceeds the available span.

* Improve the fix.

* Revert this change.

* Adding unit test around invalid range

* Checking for too many slices too.

* Small cleanup.

---------

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
.pre-commit-config.yaml
bindings/python/src/lib.rs
bindings/python/tests/test_simple.py
flake.nix
safetensors/src/slice.rs