]>
khamidou — GitHub mirrors - safetensors.git/log
Hayden Donnelly [Thu, 18 Jan 2024 12:36:38 +0000 (07:36 -0500)]
Fix mispelling of dictionary. (#410)
Arseny Kapoulkine [Thu, 18 Jan 2024 12:21:01 +0000 (04:21 -0800)]
Implement PyTorch support for float8 types (F8_E5M2 and F8_E4M3) (#404)
* Implement PyTorch support for float8 types (F8_E5M2 and F8_E4M3)
Note that PyTorch name for e4m3 type has an extra "fn" prefix to match
MLIR, but the format should be the same ("fn" means "finite").
We also test that -0.5 roundtrips in both formats, which makes sure that
the format is preserved properly - both types are single-byte and have
the same representation for zero, but different representations for
-0.5.
* Transparently support PyTorch before 2.1 by ignoring float8 formats
Ben Beasley [Thu, 18 Jan 2024 12:10:45 +0000 (07:10 -0500)]
Fix missing Apache-2.0 license file in the published crate (#416)
Add a symbolic link to the top-level LICENSE file.
Nicolas Patry [Wed, 17 Jan 2024 16:38:44 +0000 (17:38 +0100)]
Removing old doc. (#427)
* Removing old doc.
* Update pyo3 to get clippy happy.
* Optional MLX install.
* Mlx only on python 3.10.
Pedro Cuenca [Thu, 11 Jan 2024 09:26:03 +0000 (10:26 +0100)]
Fix path in version_tag_suffix (#426)
Followup to #420. Sorry.
We're almost there, examine the first `<source>` link in https://huggingface.co/docs/safetensors/api/torch to verify.
Mishig [Mon, 8 Jan 2024 22:42:52 +0000 (23:42 +0100)]
[docs] Use `hfoptions` for metadata (#424)
* [docs] Use `hfoptions` for metadata
* better wording
Pedro Cuenca [Mon, 8 Jan 2024 09:24:21 +0000 (10:24 +0100)]
[docs, untested] Attempt to fix links to source (#420)
Nicolas Patry [Fri, 5 Jan 2024 13:36:08 +0000 (14:36 +0100)]
Adding MLX backend. (#419)
* Adding MLX backend.
* Apply suggestions from code review
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
* Update bindings/python/py_src/safetensors/mlx.py
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
* Update bindings/python/py_src/safetensors/mlx.py
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
---------
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
Mishig [Thu, 4 Jan 2024 11:00:24 +0000 (12:00 +0100)]
[docs] Update list of projects using safetensors (#418)
Add `mlx` & `candle`
Lucain [Thu, 4 Jan 2024 11:00:11 +0000 (12:00 +0100)]
Document `huggingface_hub.get_safetensors_metadata` (#417)
* Document huggingface_hub.get_safetensors_metadata
* Update docs/source/metadata_parsing.mdx
Co-authored-by: Mishig <dmishig@gmail.com>
* Update docs/source/metadata_parsing.mdx
Co-authored-by: Mishig <dmishig@gmail.com>
* add import line
* Update docs/source/metadata_parsing.mdx
Co-authored-by: Mishig <dmishig@gmail.com>
---------
Co-authored-by: Mishig <dmishig@gmail.com>
Nicolas Patry [Tue, 5 Dec 2023 15:00:09 +0000 (16:00 +0100)]
Adding stale action. (#398)
* Releasing for python 3.12/3.13 and testing on 3.11.
No 3.12 yet torch... https://github.com/pytorch/pytorch/issues/110436
* Fix dev version.
* Removing paddlepaddle for default tests. protobuf conflict issue being
too old.
* Skip paddle when not installed.
* Adding a stale action.
Nicolas Patry [Mon, 27 Nov 2023 14:42:37 +0000 (15:42 +0100)]
Releasing for python 3.12/3.13 and testing on 3.11. (#393)
* Releasing for python 3.12/3.13 and testing on 3.11.
No 3.12 yet torch... https://github.com/pytorch/pytorch/issues/110436
* Fix dev version.
* Removing paddlepaddle for default tests. protobuf conflict issue being
too old.
* Skip paddle when not installed.
lachlancahill [Mon, 27 Nov 2023 13:58:28 +0000 (02:58 +1300)]
Fix/errors for some models including Mistral-7b and Flan-ul2 (#388)
* For some models like Mistral and Flan-UL2, when downloaded from the hub the binary files write to a snapshots/<uuid> subdirectory. Then when the files are committed, they cannot be found and the commit fails with an error.
* Changed `local.split("/")[-1]` to os.path.basename(local) for compatibility with all OS including Windows.
* Removed snapshots section
* Removed additional line break.
---------
Co-authored-by: Lachlan Cahill <lachlan.cahill@gmail.com>
Nicolas Patry [Mon, 27 Nov 2023 11:08:23 +0000 (12:08 +0100)]
Upgrade dev version. (#392)
Nicolas Patry [Mon, 20 Nov 2023 10:22:45 +0000 (11:22 +0100)]
Fix convert. (#390)
Hz, Ji [Mon, 20 Nov 2023 09:23:44 +0000 (17:23 +0800)]
Adding support for Ascend NPU (#372)
* Adding support for Ascend NPU
* remove the unnecessary hack code
* test more dtype
* npu doesn't support calling torch.allclose with bf16 for now
Nicolas Patry [Fri, 17 Nov 2023 18:04:45 +0000 (19:04 +0100)]
Ignore closed PRs to avoid spam. (#385)
Nicolas Patry [Fri, 17 Nov 2023 17:28:16 +0000 (18:28 +0100)]
Better convert. (#384)
Nicolas Patry [Fri, 17 Nov 2023 13:52:58 +0000 (14:52 +0100)]
Support fp8_e4m3/fp8_e5m2 (#383)
* Support fp8_e4m3/fp8_e5m2
* Moving to regular README include, which is easier to manage.
* Update README.md
Jonathan Chang [Fri, 17 Nov 2023 13:45:02 +0000 (21:45 +0800)]
Fix typo (#377)
Signed-off-by: Jonathan Chang <31893406+cccntu@users.noreply.github.com>
Nicolas Patry [Fri, 17 Nov 2023 13:31:47 +0000 (14:31 +0100)]
Supporting bfloat16 for tensorflow + jax (was failing because of (#382)
intermediary numpy).
Nicolas Patry [Wed, 4 Oct 2023 15:06:19 +0000 (17:06 +0200)]
Preparing a new release (0.4.0). (#366)
* Preparing a new release (0.4.0).
- Moving to 0.4.1 for the dev mode already
- Major upgrade just because the build system was revamped, not actual
major or breaking changes.
* Fix dep
bart [Wed, 20 Sep 2023 15:07:58 +0000 (17:07 +0200)]
fix: add py.typed (#365)
Nicolas Patry [Mon, 18 Sep 2023 14:45:47 +0000 (16:45 +0200)]
Stop recreating the hashmap all the time. (#363)
* Stop recreating the hashmap all the time.
Fixes #361
Potentially superseeds #362
Co-Authored-By: Batuhan Taskaya <batuhan@python.org>
* Adding the benches.
---------
Co-authored-by: Batuhan Taskaya <batuhan@python.org>
Paul Bricman [Mon, 18 Sep 2023 14:45:28 +0000 (17:45 +0300)]
Minor docstring edit to flax.py (#359)
Nicolas Patry [Fri, 8 Sep 2023 11:38:51 +0000 (13:38 +0200)]
Fixing release script for windows aarch64 and 3.12 (#348)
Kevin Hu [Fri, 8 Sep 2023 07:25:12 +0000 (00:25 -0700)]
Update torch.py (#356)
Steven Liu [Wed, 6 Sep 2023 07:52:14 +0000 (00:52 -0700)]
[docs] Convert weights (#345)
* Create convert-weights.md
* Update _toctree.yml
* convert space option only
cospectrum [Wed, 30 Aug 2023 11:13:13 +0000 (14:13 +0300)]
Reduce memory allocations (#350)
Nicolas Patry [Fri, 25 Aug 2023 07:26:20 +0000 (09:26 +0200)]
Trying out maturin. (#344)
* Trying out maturin.
* Yaml.
* We don't need lock right now.
* Dont skip.
* Working dir.
* Default working dir.
* Wroking dir here ?
* Fix ls
* Maturin makes things simpler.
* Clippy.
* New version number
* Update conda build.
* Conda.
* Conda.
* Drop 3.7, add 3.11
* Linux update 3.11
* Version
* Done.
* Remove afl
* Put rust code also in dev mode.
* Pre-release requires explicit everywhere.
* Remove manual sdist
* Remove custom builds
* Requires lock
* Fix sdist.
* Sed.
Nicolas Patry [Thu, 24 Aug 2023 08:16:18 +0000 (10:16 +0200)]
win64 (#343)
Nicolas Patry [Thu, 24 Aug 2023 07:28:59 +0000 (09:28 +0200)]
Win64. (#342)
Nicolas Patry [Wed, 23 Aug 2023 14:28:00 +0000 (16:28 +0200)]
Python 3.8 for arm (#339)
Nicolas Patry [Wed, 23 Aug 2023 13:20:09 +0000 (15:20 +0200)]
Fixing release script. (#338)
Nicolas Patry [Wed, 23 Aug 2023 11:25:47 +0000 (13:25 +0200)]
Don't release rust versions on RC (#337)
Nicolas Patry [Wed, 23 Aug 2023 11:22:28 +0000 (13:22 +0200)]
Temporary revert of the breaking change (keep it for 0.4.0). (#336)
Nicolas Patry [Wed, 23 Aug 2023 11:00:06 +0000 (13:00 +0200)]
Preparing small patch release (Big Endian fix). (#335)
Nicolas Patry [Tue, 22 Aug 2023 09:25:11 +0000 (11:25 +0200)]
Reworked the release script entirely (#334)
* Rework the release script entirely.
* New release script.
* Ok.
Corey Lowman [Mon, 21 Aug 2023 07:14:25 +0000 (03:14 -0400)]
impl `View` for `TensorView` (#329)
The existing impl only exists for `&TensorView`, which means you cannot pass a `Vec<(String, TensorView)>` into `serialize_to_file`. With this new impl, you can.
Thomas Chaigneau [Mon, 21 Aug 2023 07:13:55 +0000 (09:13 +0200)]
Add NumPy for all backends dependencies (#332)
* Add NumPy for all backends dependencies
* numpy as extras
Nicolas Patry [Thu, 17 Aug 2023 06:58:26 +0000 (08:58 +0200)]
Fixing boolean + numpy > 1.20 (#326)
* Fixing boolean + numpy > 1.20
* Adding bool numpy test.
Nicolas Patry [Thu, 17 Aug 2023 06:44:48 +0000 (08:44 +0200)]
Fixing big endian. (#327)
* Fixing big endian.
- Many more tests, with numpy coverage.
- Actually test values on disk.
* Re-enabling bf16 (we piggy back f16 byteswap).
* Fmt.
* Black.
Nicolas Patry [Wed, 16 Aug 2023 18:16:20 +0000 (20:16 +0200)]
Yaml is nice. (#325)
Nicolas Patry [Wed, 16 Aug 2023 16:06:37 +0000 (18:06 +0200)]
Fix Bench GH action. (#323)
Thomas Chaigneau [Wed, 16 Aug 2023 15:52:12 +0000 (17:52 +0200)]
add tensorshare to featured projects (#322)
Nicolas Patry [Fri, 11 Aug 2023 21:29:45 +0000 (23:29 +0200)]
Supporting whisper conversion. (#320)
Nicolas Patry [Fri, 11 Aug 2023 14:12:47 +0000 (16:12 +0200)]
Cache dir all the time. (#319)
Nicolas Patry [Wed, 9 Aug 2023 07:15:33 +0000 (09:15 +0200)]
Fixing macos 13 release script (by prebuilding). (#315)
* Fixing macos 13 release script (by prebuilding).
* Yaml indent...
Nicolas Patry [Wed, 9 Aug 2023 07:14:23 +0000 (09:14 +0200)]
Adding new target for m1 (#317)
* Adding new target for m1
* Indent fix.
Aarni Koskela [Tue, 8 Aug 2023 10:04:20 +0000 (12:04 +0200)]
Clarify specification around endianness and header padding (#306)
* Clarify that `N` is little-endian
* Clarify the header JSON structure:
* note the data must begin with a `{` byte
* note the data may be padded at the end with whitespace
* Update README.md
Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
---------
Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
Nicolas Patry [Tue, 8 Aug 2023 10:04:14 +0000 (12:04 +0200)]
Back on dev. (#313)
Nicolas Patry [Mon, 7 Aug 2023 21:36:24 +0000 (23:36 +0200)]
Fixes release scripts - Release ready version (#312)
* Creating 0.3.2.rc1 release
* Fixing release.
* Fix mv 2
* Ignore failing mv.
* ?
* Wtf ?
* ???
* What is happenin to my files...
* macos-latest.
* Fixing up release.
Nicolas Patry [Mon, 7 Aug 2023 13:46:19 +0000 (15:46 +0200)]
Creating 0.3.2.rc1 release (#311)
Nicolas Patry [Mon, 7 Aug 2023 12:53:19 +0000 (14:53 +0200)]
feat: Supporting big endian architecture. (#310)
* Supporting big endian architecture.
`byteswap` before saving and `byteswap` on read.
* Specify platform ?
* Revert "Specify platform ?"
This reverts commit
8d82bbd15374d066eb2578a00f38c7dc91b83f74 .
* GH
* With cache ?
* Switch driver for cache ?
* Push
* Using internal registry
* Fix build push.
* Add platform ?
* PlatformS
Nicolas Patry [Mon, 7 Aug 2023 07:08:02 +0000 (09:08 +0200)]
feat: Add filter for shared storage non overlapping tensors (#309)
* feat: Add filter for shared storage non overlapping tensors
Deepspeed does some tensor sharing but not actually overlapping
tensors. (It's not exactly clear why).
This PR fixes it by adding a global check for all shared tensors if the
actual offsets are overlapping or not.
It looks at all (start, stop) pointers of the tensors, sorts them by start pointer, and decides 2 tensors are disjoint if stop(previous) <= start(next)
* Style.
* Update for zero-sized tensors.
* Update test that now passes.
Benson Liu [Tue, 1 Aug 2023 12:55:58 +0000 (05:55 -0700)]
fix typo in `attacks/README.md` (#305)
Nicolas Patry [Mon, 31 Jul 2023 14:41:25 +0000 (16:41 +0200)]
Adding `slice` `get_dtype()` method to get the dtype directly on slices. (#303)
Nicolas Patry [Mon, 31 Jul 2023 14:00:59 +0000 (16:00 +0200)]
Passing the token around. (#302)
* Passing the token around.
* Update Python version (flax is broken on 3.7)
* Fixing flax ?
* Apply suggestions from code review
Nicolas Patry [Tue, 11 Jul 2023 12:52:00 +0000 (14:52 +0200)]
Support musicgen conversion. (#296)
Wouter Zwerink [Fri, 7 Jul 2023 13:05:57 +0000 (15:05 +0200)]
Fix link to shared tensor page (#294)
Wouter Zwerink [Fri, 7 Jul 2023 11:21:02 +0000 (13:21 +0200)]
Autodoc for save_model and load_model (#293)
Nicolas Patry [Fri, 7 Jul 2023 09:33:14 +0000 (11:33 +0200)]
Adding more control to the chosen weights saved on disk. (#292)
Akinori Mitani [Tue, 4 Jul 2023 14:41:59 +0000 (07:41 -0700)]
Fix docstring Args names. (#290)
Fix docstring Args names.
Mishig [Fri, 30 Jun 2023 13:13:17 +0000 (15:13 +0200)]
Revert dev change (#288)
Mishig [Fri, 30 Jun 2023 10:30:41 +0000 (12:30 +0200)]
Fix failing doc build workflows (#287)
* [wip: fix docs]
* wip
* pin tf version for doc-builder
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)