]>
khamidou — GitHub mirrors - safetensors.git/log
Nicolas Patry [Fri, 30 Jun 2023 08:32:00 +0000 (10:32 +0200)]
Superseed #279 (#285)
* Update README.md
Add note about arbitrary JSON not allowed in __metadata__.
* Update README.md
Co-authored-by: Julien Chaumond <julien@huggingface.co>
* Update other readmes.
---------
Co-authored-by: by321 <by321@hotmail.com>
Co-authored-by: Julien Chaumond <julien@huggingface.co>
Nicolas Patry [Fri, 30 Jun 2023 07:53:38 +0000 (09:53 +0200)]
Fixing uniform empty tensor handling (#283)
- Fixes #280
Alvaro Moran [Fri, 30 Jun 2023 07:16:05 +0000 (09:16 +0200)]
Fix wrong docstring for SafeTensors' names method (#250) (#284)
Nicolas Patry [Tue, 27 Jun 2023 09:39:55 +0000 (11:39 +0200)]
Missing files. (#282)
* Update README.md
* Missing files.
---------
Co-authored-by: iacore <74560659+iacore@users.noreply.github.com>
Jakub Kaczmarzyk [Wed, 21 Jun 2023 10:21:48 +0000 (06:21 -0400)]
fix syntax error in import statement (#276)
Laurent Mazare [Thu, 15 Jun 2023 15:00:03 +0000 (16:00 +0100)]
Add a reference to tch-rs (#274)
Thomas Wang [Tue, 13 Jun 2023 16:20:19 +0000 (18:20 +0200)]
Make tensor identifier a bit more robust, and transformers compatible (#264)
* Make tensor identifier a bit more robust, and transformers compatible
* Prove that you need to storage storage size as well
* Lint
* Backward compatility for torch version
* Lint
* Fixing tests.
* Test supporting mutliple torch versions.
* Fixing _flatten share pointer detection.
* More code reuse.
* Better error message.
* Attempting to debug what's wrong.
* Fixing torch 1.13... God this is awful.
* Latest python ?
* Dancing with versions.
* ..
---------
Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
Mishig [Fri, 9 Jun 2023 10:59:02 +0000 (12:59 +0200)]
[doc build] Use secrets (#270)
Nicolas Patry [Wed, 7 Jun 2023 11:56:51 +0000 (13:56 +0200)]
Remove ISSUE links. (#269)
Nicolas Patry [Wed, 7 Jun 2023 11:45:47 +0000 (13:45 +0200)]
Adding issue templates. (#268)
Kazuaki Ishizaki [Tue, 6 Jun 2023 13:14:50 +0000 (13:14 +0000)]
fix typos (#257)
Daniel van Strien [Tue, 6 Jun 2023 13:12:43 +0000 (14:12 +0100)]
Add BERTopic in Featured Projects (#267)
Nicolas Patry [Tue, 6 Jun 2023 11:03:30 +0000 (13:03 +0200)]
Adding error checking, convertion can fail on schedulers. (#266)
* Adding error checking, convertion can fail on schedulers.
* Printing messages on using the script directly.
Alvaro Bartolome [Mon, 5 Jun 2023 14:40:06 +0000 (16:40 +0200)]
Add `safejax` in "Featured Projects" (#260)
Mishig [Fri, 2 Jun 2023 08:26:28 +0000 (10:26 +0200)]
Update metadata_parsing.mdx (#261)
Add links to featured models
Nicolas Patry [Mon, 22 May 2023 14:07:24 +0000 (16:07 +0200)]
Fixing the spec with mention about the buffer which cannot be non-contiguous. (#253)
* Adding specification that the byte buffer needs to be contiguous and
full.
* Fix cargo.lock which messes up benchmarks.
Mishig [Mon, 22 May 2023 14:00:54 +0000 (16:00 +0200)]
[docs] Safetensors format (#248)
* [docs] Safetensors format
* More text
* Add format illustration
Funtowicz Morgan [Mon, 22 May 2023 13:26:06 +0000 (15:26 +0200)]
Added method `len` on `SafeTensors` (#252)
* Added method `len` on `SafeTensors` in order to avoid allocating a new tensor through `names()` or `tensors()`
* Make clippy happy with `is_empty() -> bool`
* Apply @Narsil suggestion regarding is_empty
Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
* Fix format.
---------
Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
Funtowicz Morgan [Mon, 22 May 2023 12:50:23 +0000 (14:50 +0200)]
Update to actions/checkout@v3 (#251)
Mishig [Fri, 19 May 2023 08:47:17 +0000 (10:47 +0200)]
[doc] featured projects (#249)
* [doc] featured projects
* typo
Mishig [Wed, 17 May 2023 13:28:49 +0000 (15:28 +0200)]
[doc] Add logo img to index doc page (#247)
* [doc] Add logo img to index doc page
* Update logo.
---------
Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
Mishig [Wed, 17 May 2023 13:18:07 +0000 (15:18 +0200)]
There should be `.dev0` while on `main` (#246)
Mishig [Wed, 17 May 2023 12:59:32 +0000 (14:59 +0200)]
[doc] Improve metadata parsing doc (#245)
* hfjs link to parsesafetensorsmetadata
* Add conditional image
* better wording
* new images
* Add python example
* Add reference to range request
* capitalization
Julien Chaumond [Wed, 17 May 2023 09:16:40 +0000 (11:16 +0200)]
[doc] Add a doc page about (remote) Metadata parsing (#243)
Would close #44
Nicolas Patry [Wed, 17 May 2023 09:15:11 +0000 (11:15 +0200)]
Adding a banner to the README. (#244)
* Adding a banner to the README.
* Svg.
* Fix size.
Nicolas Patry [Tue, 25 Apr 2023 12:34:04 +0000 (14:34 +0200)]
Fixing conda workflow. (#240)
Nicolas Patry [Tue, 25 Apr 2023 08:24:04 +0000 (10:24 +0200)]
Prepare 0.3.2 (#239)
Nicolas Patry [Mon, 24 Apr 2023 14:21:09 +0000 (16:21 +0200)]
New release candidate. (#224)
Nicolas Patry [Mon, 24 Apr 2023 14:15:32 +0000 (16:15 +0200)]
Fixing shared detection logic. (#232)
* Fixing shared tensor logic.
* Fixing shared detection logic.
* torch 1.10 support.
* Rebase.
Nicolas Patry [Mon, 24 Apr 2023 10:37:00 +0000 (12:37 +0200)]
Adding `save_model` and `load_model` to help with shared tensors with PyTorch. (#236)
* Adding `save_model` and `load_model` to help with shared tensors
and non contiguous tensors.
* Tmp.
* Adding more docs more tests on the edge cases.
* Adding support for different `keep_name` on disk.
* Torch 1.10 support + save_model failure test.
* Fixes 1.10
* Debugging on remote..
* 1.
* 2.
* 3.
* 4.
* Trying to fix documentation builder version.
* PR documentation + route from error message to new methods.
* ..
* Revert ".."
This reverts commit
564b6863fc11407e19982944733de999c17c95ba .
* Fixing `.[dev]` ?
* Adding contiguous support.
* ?
* Fix.
Nicolas Patry [Fri, 21 Apr 2023 12:54:22 +0000 (14:54 +0200)]
Fixing alignment (#235)
* Alignment checking.
* Fix alignments.
* Updating python tests.
* Improve a bit readability.
Nicolas Patry [Wed, 19 Apr 2023 13:46:04 +0000 (15:46 +0200)]
Fixing the logic to determine if PR is up-to-date. (#230)
* Fixing the logic to determine if PR is up-to-date.
* Update bindings/python/convert.py
Nicolas Patry [Wed, 12 Apr 2023 14:18:58 +0000 (16:18 +0200)]
Committing Cargo.lock. (#233)
* Committing Cargo.lock.
* Update .gitignore
Co-authored-by: Mishig <dmishig@gmail.com>
---------
Co-authored-by: Mishig <dmishig@gmail.com>
Nicolas Patry [Thu, 6 Apr 2023 11:08:14 +0000 (13:08 +0200)]
Minor checks + proptest in python. (#228)
* Minor checks + proptest in python.
* Fix readme.
* Tf version.
* Fix.
* Jax version.
* Jaxlib.
* Jax.
* Cannot have jax version
- Python 3.7 is minimal version for which they don't have release
jax>0.4
- Our doc builder relies on jax>0.4
* wtf.
* .
* ...
* Wahtever.
Nicolas Patry [Thu, 6 Apr 2023 08:27:38 +0000 (10:27 +0200)]
Specify python versions. (#227)
Nicolas Patry [Thu, 6 Apr 2023 08:27:30 +0000 (10:27 +0200)]
0-sized tensors allowed. (#226)
Nicolas Patry [Thu, 6 Apr 2023 08:27:13 +0000 (10:27 +0200)]
Adding last missing test for validate. (#225)
Nicolas Patry [Thu, 30 Mar 2023 12:58:08 +0000 (14:58 +0200)]
Remove the breaking change of disallowing zero sized tensors. (#221)
* Remove the breaking change of disallowing zero sized tensors.
Some files out there might exist with this.
While being questionnable, it's not worth doing a breaking change
since there doesn't seem to be either a security implication
nor a performance hit.
* Full support for zero-sized tensor on torch==1.10
* Adding a nice comment.
Nicolas Patry [Wed, 29 Mar 2023 08:58:08 +0000 (10:58 +0200)]
Fixing empty shape test. (#218)
Nicolas Patry [Wed, 29 Mar 2023 08:57:32 +0000 (10:57 +0200)]
Add a safety warning in the convertion script. (#219)
* Add a safety warning in the convertion script.
* Fix test temporarily.
Nicolas Patry [Wed, 29 Mar 2023 08:57:14 +0000 (10:57 +0200)]
Adding arithmetic overflow checks (unchecked in release builds). (#207)
* Adding arithmetic overflow checks (unchecked in release builds).
* Fix rebase
Nicolas Patry [Tue, 28 Mar 2023 13:53:50 +0000 (15:53 +0200)]
Overspecify a bit the format. (#215)
* Updating the README to overspecify JSON.
* Overspecify a bit the format.
* Stop being annoying.
* Fixing python cache + gh action.
* Fix audit.
* Fixing rust cache for python directory ?
Nicolas Patry [Tue, 28 Mar 2023 13:47:23 +0000 (15:47 +0200)]
Disallow erroneous buffer. (#206)
Nicolas Patry [Tue, 28 Mar 2023 13:45:39 +0000 (15:45 +0200)]
Disallowing zero-width tensor. (#205)
* Disallowing zero-width tensor.
* Fix test.
Nicolas Patry [Tue, 28 Mar 2023 13:45:08 +0000 (15:45 +0200)]
Adding simple proptest. (#216)
Nicolas Patry [Tue, 28 Mar 2023 13:32:41 +0000 (15:32 +0200)]
Zero width shape are OK (0-rank tensors). They are simply a scalar. (#208)
* Zero width shape are OK (0-rank tensors). They are simply a scalar.
Reasosn for support is that both torch and numpy support them, and
they flow naturally from the definition that an empty product has
length 1.
* not allowed -> allowed
Nicolas Patry [Tue, 28 Mar 2023 13:20:39 +0000 (15:20 +0200)]
Deactivating codecov commenting. (#217)
Nicolas Patry [Tue, 28 Mar 2023 12:13:38 +0000 (14:13 +0200)]
Increase coverage on the error paths. (#214)
Nicolas Patry [Tue, 28 Mar 2023 10:46:09 +0000 (12:46 +0200)]
Fixing codecov rust tag. (#213)
Nicolas Patry [Tue, 28 Mar 2023 10:40:20 +0000 (12:40 +0200)]
Oops. (#212)
Nicolas Patry [Tue, 28 Mar 2023 10:33:56 +0000 (12:33 +0200)]
Upload codecov for main branch. (#211)
Nicolas Patry [Tue, 28 Mar 2023 10:26:19 +0000 (12:26 +0200)]
Remove unwrap in prod code. (#209)
Nicolas Patry [Tue, 28 Mar 2023 10:24:44 +0000 (12:24 +0200)]
More badges. (#210)
* More badges.
* Update action to create codecov.
* Update readmes.
* Fix doc link.
* Two lines for Python and Rust.
* Doc link.
* Fix badge label.
* Use simpler run to get default working-dir.
* Fix ?
* Audit.
* Ignore criterion issue.
* Better command line ?
* codecov token.
* Working dir.
* Specify file.
* Fixing upload only on ubuntu.
* Code coverage only on linux.
* Fix codecov link.
nickkolok [Tue, 28 Mar 2023 08:20:42 +0000 (11:20 +0300)]
Minor improvements for README (#201)
* Use `s for code
* Fix typos in README
* All readmes.
* Adding Rust cache and latest ubuntu for python tests.
---------
Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
Nicolas Patry [Mon, 27 Mar 2023 08:30:56 +0000 (10:30 +0200)]
Adding a minimal version for torch. (#204)
Nicolas Patry [Fri, 17 Mar 2023 14:56:06 +0000 (15:56 +0100)]
Python 2.0 added a warning on ByteStorage, so using UntypedStorage (#196)
* Python 2.0 added a warning on ByteStorage, so using UntypedStorage
directly for that version.
Small error in their docs, `size` got renamed `nbytes`.
* Remove unused work.
Nicolas Patry [Fri, 17 Mar 2023 09:42:34 +0000 (10:42 +0100)]
Adding commit description to convertion PR. (#198)
* Adding commit description to convertion PR.
* Update bindings/python/convert.py
Co-authored-by: Omar Sanseviero <osanseviero@gmail.com>
* Adding suggestion for reporting issues.
---------
Co-authored-by: Omar Sanseviero <osanseviero@gmail.com>
Nicolas Patry [Mon, 13 Mar 2023 10:35:40 +0000 (11:35 +0100)]
Nicer error when failed to find tensor in Rust. (#191)
Co-authored-by: Ubuntu <ubuntu@ip-172-31-34-94.eu-west-3.compute.internal>
Nicolas Patry [Mon, 13 Mar 2023 10:35:27 +0000 (11:35 +0100)]
Making sure the safetensors existing PR is up-to-date. (#192)
* Making sure the safetensors existing PR is up-to-date.
* Fixed `target_branch` exists only on details.
Nicolas Patry [Wed, 8 Mar 2023 12:01:26 +0000 (13:01 +0100)]
Adding memmap example to read from file. (#189)
Nicolas Patry [Wed, 8 Mar 2023 12:01:11 +0000 (13:01 +0100)]
Remove too many keywords. (#187)
Nicolas Patry [Fri, 3 Mar 2023 14:21:07 +0000 (15:21 +0100)]
Version 0.3.0 (#186)
Nicolas Patry [Wed, 1 Mar 2023 20:45:08 +0000 (21:45 +0100)]
Preparing for release 0.3rc1. (#185)
* Preparing for release 0.3rc1.
* Full version number.
Nicolas Patry [Tue, 28 Feb 2023 15:19:40 +0000 (16:19 +0100)]
Faster GPU Loads ?? (#184)
* Faster GPU Loads ??
Beats my expectations. I wonder what I did do to not see this perf
bottleneck/improvements.
* Pyslice still not fixed on PyO3.
* Upgrade PyO3.
* Using newer pyo3.
* Make benches Windows friendly.
Nicolas Patry [Fri, 24 Feb 2023 13:56:51 +0000 (14:56 +0100)]
Better Rust API (tch-rs) (#179)
* Implementing a trait API for the Rust (should make tch-rs interaction
easier).
* Companion type.
* Re-export major formats + 3rd example in the trait doc.
* Even clearer OpaqueGPU type.
* Moving to `Cow<[u8]>`. Feels simpler.
* Fixes.
Dwayne Robinson [Fri, 24 Feb 2023 10:12:57 +0000 (02:12 -0800)]
README.md proposed clarity (#181)
* README.md proposed clarity
I had to look via a hex editor at an existing .safetensors file to figure it out (maybe this will accelerate others slightly to adopt it 😅), because parentheses "(...)" are not legal JSON, and it wasn't clear to me whether the offsets were file relative or byte buffer relative.
* Update other readme.
---------
Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
Nicolas Patry [Tue, 21 Feb 2023 14:23:56 +0000 (15:23 +0100)]
[Major Change] Enforcing tensor alignment (#148)
* [Major Change] Enforcing tensor alignment
- Now the header will automatically align itself to 8 bytes (f64) with
appending extra spaces as necessary.
- This will allow extra fast memory mapping by reinterpreting bytes as
f32/f64 etc.. Unaligned bytes do not allow for this. https://www.reddit.com/r/rust/comments/tanaxm/mutating_a_buffer_of_u8s_as_f32s_in_place/
- This does not change contiguousness of tensors
- This does not change the actual spec (we're just putting extra valid bytes
in the header and using a different serialization ordering)
- Readers should still be able to read old files, they would just need
to be copied before being cast as their final destination when using
mmap
- This has no effect for GPU since copy is already necessary (*I think*,
depends on the cuda API actually if it allows filling f32 addresses
from raw unaligned bytes).
This change will only be interesting if things like https://github.com/Narsil/fast_gpt2
actually pick up. And even with the copy, load times are still vastly
superior to `pytorch`.
We need to be able to read old files.
* Fixup.
* Clippy fix.
* Cargo fmt (clippy --fix broke it ? :( )
yujun [Wed, 8 Feb 2023 10:06:05 +0000 (18:06 +0800)]
add paddle docs (#177)
yujun [Tue, 7 Feb 2023 14:44:54 +0000 (22:44 +0800)]
Add PaddlePaddle backend (#176)
* add paddle backend
* add paddle ace
* update docs
* Some modifications.
* Consistency.
* Showing Paddle format.
* donot modify lib.rs
* remove test_deserialization_safe_open test
* rm unused import
* make style
* Style.
---------
Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
Nicolas Patry [Mon, 6 Feb 2023 11:05:40 +0000 (12:05 +0100)]
Fixing error message for FileNotFound. (#175)
* Fixing error message for FileNotFound.
* Old PR readme fix.
Nicolas Patry [Mon, 30 Jan 2023 13:00:51 +0000 (14:00 +0100)]
Update README.md (#170)
Fixes #169 169
Nicolas Patry [Mon, 30 Jan 2023 12:59:40 +0000 (13:59 +0100)]
Clippy fix. (#171)
* Clippy fix.
* And tests.
Nicolas Patry [Fri, 20 Jan 2023 14:05:24 +0000 (15:05 +0100)]
Better error messages on outdated context manager. (#168)
* Better error messages on outdated context manager.
* Clippy.
* Remove unwrap.
* Fix.
John B Nelson [Fri, 20 Jan 2023 10:07:11 +0000 (02:07 -0800)]
Minor pydoc fixes for torch bindings (#167)
Nicolas Patry [Thu, 19 Jan 2023 13:30:56 +0000 (14:30 +0100)]
Fixing the fact that the context manager wasn't properly cleaning up after itself. (#166)
* Adding failing test for windows.
* This should fail.
* Fixing Windows issue by actually dropping the rust resources.
* Making the rust module private.
Nicolas Patry [Tue, 17 Jan 2023 17:06:34 +0000 (18:06 +0100)]
Adding custom error type for users to properly catch. (#165)
KOLANICH [Tue, 17 Jan 2023 16:39:47 +0000 (16:39 +0000)]
Added JSONSchema of the header. (#151)
Nicolas Patry [Tue, 17 Jan 2023 09:04:04 +0000 (10:04 +0100)]
Enabling 3.8 support for M1. (#162)
Thomas Wang [Tue, 17 Jan 2023 09:02:28 +0000 (10:02 +0100)]
Update README.md (#163)
* Update README.md
Link to huggingface.co documentation
* Make rust doc match
* Why is the documentation at three different places?
Nicolas Patry [Mon, 16 Jan 2023 15:40:29 +0000 (16:40 +0100)]
New unreleased version. (#161)
* New unreleased version.
* Making only 1 release now.
Thomas Wang [Mon, 16 Jan 2023 14:28:18 +0000 (15:28 +0100)]
Improve type hinting (#159)
Nicolas Patry [Mon, 16 Jan 2023 12:42:22 +0000 (13:42 +0100)]
Fix byte order detection for `np.uint8` and other types for which byte order is not defined. (#160)
* Fix byte order detection for `np.uint8` and other types for which byte order is not defined.
* Fixing np.uint8 endianness for `save`.
Co-authored-by: KOLANICH <kolan_n@mail.ru>
Nicolas Patry [Mon, 16 Jan 2023 09:34:28 +0000 (10:34 +0100)]
Preparing next version. (#158)
Nicolas Patry [Fri, 30 Dec 2022 13:28:44 +0000 (14:28 +0100)]
Updating rust ergonomics. (#144)
- `get_` prefix removed in a few functions.
- Make error implement Error.
Nicolas Patry [Thu, 29 Dec 2022 07:17:56 +0000 (08:17 +0100)]
Fixing torch version parsing. (#143)
* Fixing torch version parsing.
* Anticipating a bit more variations of this.
Alvaro Bartolome [Tue, 27 Dec 2022 09:02:52 +0000 (10:02 +0100)]
Update docstrings & type-hints (#139)
Nicolas Patry [Tue, 27 Dec 2022 08:13:28 +0000 (09:13 +0100)]
Making SAFETENSORS_FAST_GPU=1 work on Windows again. (#140)
* Making Windows load cudart differently.
* Remove unsafe.
* Misplaced comment
Nicolas Patry [Mon, 19 Dec 2022 12:50:15 +0000 (13:50 +0100)]
Adding stale bot. (#135)
* Adding stale bot.
* Clippy.
Vilém Zouhar [Thu, 15 Dec 2022 08:38:37 +0000 (09:38 +0100)]
Fix readme typos (#133)
* fix readme typos
* Replicating docs on all 3 files.
Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
Nicolas Patry [Wed, 14 Dec 2022 12:55:28 +0000 (13:55 +0100)]
New version. (#132)
Thomas Wang [Wed, 14 Dec 2022 10:23:50 +0000 (11:23 +0100)]
Update README.md (#131)
* Update README.md
* Update other files.
Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
Nicolas Patry [Tue, 13 Dec 2022 16:17:42 +0000 (17:17 +0100)]
Fixing it for `diffusers`. (#130)
Nicolas Patry [Tue, 13 Dec 2022 15:14:56 +0000 (16:14 +0100)]
Necessary modifications to publish on Rust. (#129)
* Adding Info to publish.
* Bench.
* Update README.
Nicolas Patry [Mon, 12 Dec 2022 13:59:19 +0000 (14:59 +0100)]
Release rust. (#126)
Nicolas Patry [Mon, 12 Dec 2022 10:40:56 +0000 (11:40 +0100)]
Keras new format is not safe. (#127)
Nicolas Patry [Mon, 12 Dec 2022 09:24:49 +0000 (10:24 +0100)]
Adding support for Python 3.11 on Linux + fix the source build wheel. (#125)
Nicolas Patry [Wed, 7 Dec 2022 16:04:03 +0000 (17:04 +0100)]
Python fuzzing. (#123)
lsb [Tue, 6 Dec 2022 09:25:11 +0000 (01:25 -0800)]
Minor typo (#121)
* Minor typo
* READMEs.
* Fix the reamde? ??
Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
Nicolas Patry [Mon, 5 Dec 2022 17:33:12 +0000 (18:33 +0100)]
Adding `cargo fuzz` and found sanitation opportunities. (#119)
* Adding `cargo fuzz` and found sanitation opportunities.
* Better code.
Nicolas Patry [Wed, 30 Nov 2022 16:01:55 +0000 (17:01 +0100)]
Supporting stable-diffusion by default. (#118)
* New updates.
* Force load checkpoint on cpu.