]> khamidou — GitHub mirrors - safetensors.git/log
safetensors.git
15 months agoFixing the version check for uint support in torch. (#643)
Nicolas Patry [Fri, 8 Aug 2025 12:33:40 +0000 (14:33 +0200)]
Fixing the version check for uint support in torch. (#643)

15 months agoFixing clippy in 1.89 (#644)
Nicolas Patry [Fri, 8 Aug 2025 12:23:12 +0000 (14:23 +0200)]
Fixing clippy in 1.89 (#644)

15 months agoPreparing for patch 6.0.1. (#638)
Nicolas Patry [Wed, 6 Aug 2025 09:11:45 +0000 (11:11 +0200)]
Preparing for patch 6.0.1. (#638)

* Preparing for patch 6.0.1.

* Tune down false positives.

15 months agoGH action... once again. (#635)
Nicolas Patry [Tue, 5 Aug 2025 16:42:32 +0000 (18:42 +0200)]
GH action... once again. (#635)

* GH action... once again.

* Using ruff instead of

* Moving to ruff instead of black

* Fixing the stub to not use black either.

* .

* Forgot to flush.

* Old torch version dont have unsigned variants.

* Fixing the handle tests.

* Installing missing numpy.

* Use numpy > 2

* ...

* Yaml.

* ..

* ...

* .....

* So annoying.

* Fix uv lock.

* Fix the fp4 tests.

* Download hdf5 library.

* ....

* ..

* ..

* ..

* ..

* ..

* ..

* ..

* .

* ..

* Fixing MLX implementation with newer versions.

* Split macos into x86 legacy and latest aarch64.

* ..

* ..

* Lock.

* ..

* .

* Numpy version.

15 months agoFix test_simple.py for 0.6.0 (#634)
Alexander Lent [Mon, 4 Aug 2025 07:40:07 +0000 (03:40 -0400)]
Fix test_simple.py for 0.6.0 (#634)

These tests look for error messages which changed in commit 3012241/PR#616.

Fixes: 3012241 ("Better error handling through improved `Display` and `Error` impls (#616)")
15 months agoAdding _safe_open_handle. (#608)
Nicolas Patry [Fri, 1 Aug 2025 15:25:35 +0000 (17:25 +0200)]
Adding _safe_open_handle. (#608)

* [WIP]. Adding safe_handle.

* Adding S3.

* File handle becomes private for merge.

16 months agoRe-adding support for u16, u32, u64. (#629)
Nicolas Patry [Thu, 3 Jul 2025 18:22:13 +0000 (20:22 +0200)]
Re-adding support for u16, u32, u64. (#629)

17 months agoRust release upgrade (cache v1 is discontinued). (#627)
Nicolas Patry [Tue, 24 Jun 2025 07:33:58 +0000 (07:33 +0000)]
Rust release upgrade (cache v1 is discontinued). (#627)

17 months agoAdding a failing test on the device cast. (#623)
Nicolas Patry [Mon, 16 Jun 2025 13:37:54 +0000 (13:37 +0000)]
Adding a failing test on the device cast. (#623)

17 months agoFixup into pyobject. (#622)
Nicolas Patry [Mon, 16 Jun 2025 13:23:05 +0000 (13:23 +0000)]
Fixup into pyobject. (#622)

17 months agoRename. (#621)
Nicolas Patry [Mon, 16 Jun 2025 06:32:30 +0000 (06:32 +0000)]
Rename. (#621)

17 months agoSimplify code and make it more robust (#615)
Árpád Goretity  [Mon, 16 Jun 2025 06:22:52 +0000 (08:22 +0200)]
Simplify code and make it more robust (#615)

* Simplify code and make it more robust

* Remove extraneous empty line

* Address review comments

---------

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
17 months agoAdding data_len as public API for metadata (to fetch the size of the (#620)
Nicolas Patry [Sun, 15 Jun 2025 10:27:13 +0000 (10:27 +0000)]
Adding data_len as public API for metadata (to fetch the size of the (#620)

data buffer).

17 months agoBumping version because of breaking changes. (#619)
Nicolas Patry [Sun, 15 Jun 2025 10:12:27 +0000 (10:12 +0000)]
Bumping version because of breaking changes. (#619)

17 months agoAdding support for MXFP4,6. (#611)
Nicolas Patry [Sun, 15 Jun 2025 10:07:05 +0000 (10:07 +0000)]
Adding support for MXFP4,6. (#611)

* Adding support for MXFP4,6.

* More rejections.

* Adding support when torch 2.8 will get release. Some nasty bits with _x2
dtype..

* Rebased.

* Rebasing after some changes.

17 months agoDo not force `&Option<T>` in public API; use `Option<&T>` instead (#617)
Árpád Goretity  [Sun, 15 Jun 2025 09:13:37 +0000 (11:13 +0200)]
Do not force `&Option<T>` in public API; use `Option<&T>` instead (#617)

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
17 months agoBetter error handling through improved `Display` and `Error` impls (#616)
Árpád Goretity  [Sun, 15 Jun 2025 09:11:36 +0000 (11:11 +0200)]
Better error handling through improved `Display` and `Error` impls (#616)

* Better error handling: reliable `Display` impls and more useful `Error` impls

* Reliable `Display` impls and improved error formatting in Python bindings

* Remove some remaining instances of unwarranted `{:?}` formtting

---------

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
17 months agoUpdate dependencies and replace deprecated `black_box()` with its std equivalent...
Árpád Goretity  [Sun, 15 Jun 2025 09:09:20 +0000 (11:09 +0200)]
Update dependencies and replace deprecated `black_box()` with its std equivalent (#614)

17 months agoAdding a public API for metadata. (#618)
Nicolas Patry [Sun, 15 Jun 2025 09:08:43 +0000 (09:08 +0000)]
Adding a public API for metadata. (#618)

* Adding a public API for metadata.

* Validate doesn't need to be public.

18 months agoAdding the License to wheels. (#606)
Nicolas Patry [Fri, 9 May 2025 08:05:54 +0000 (10:05 +0200)]
Adding the License to wheels. (#606)

* Adding the License to wheels.

* Adding the License without path traversal.

18 months agoFixing the ml_dtypes potentially missing. (#605)
Nicolas Patry [Fri, 9 May 2025 07:46:35 +0000 (09:46 +0200)]
Fixing the ml_dtypes potentially missing. (#605)

Co-authored-by: Daniel Bershatsky <daniel.bershatsky@gmail.com>
18 months agoEarly bailing when keys mismatch (faster). (#602)
Nicolas Patry [Fri, 9 May 2025 07:03:12 +0000 (09:03 +0200)]
Early bailing when keys mismatch (faster). (#602)

* Early bailing when keys mismatch (faster).

* Add a few comments.

* NIT.

* Small fix.

18 months agoRemove useless code (#597)
cychester [Fri, 9 May 2025 06:59:18 +0000 (14:59 +0800)]
Remove useless code (#597)

18 months agofix typo in serialize_file doc-string (#594)
Luca Vivona [Fri, 9 May 2025 06:57:51 +0000 (02:57 -0400)]
fix typo in serialize_file doc-string (#594)

* fix typo in serialize_file doc-string

* update __init__.pyi serialize_file

18 months agoFix the bench action ? (#603)
Nicolas Patry [Mon, 5 May 2025 19:32:38 +0000 (21:32 +0200)]
Fix the bench action ? (#603)

* Fix the bench action ?

* Fixing the project by removing python 3.7 support from the bench.

* Removing 3.8 support (messes up tensorflow pinned version).

20 months ago[WIP] Enabling free-threaded python (without warning). + pyo3 0.24 (#592)
Nicolas Patry [Tue, 18 Mar 2025 09:00:47 +0000 (10:00 +0100)]
[WIP] Enabling free-threaded python (without warning). + pyo3 0.24 (#592)

* [WIP] Enabling free-threaded python (without warning). + pyo3 0.24

* Adding free threaded ?

* Make simple tests thread resistant + Fix 3.13t tests ?.

* ?

* Yaml insanity.

* Names.

* Last attempt.

* Split tensorflow

* Using index for freethreaded build.

* So tiring.

* names everywhere.

* Fixing the workflow jax + freethreaded doesn't work.

20 months agoFix test (#591)
Nicolas Patry [Mon, 17 Mar 2025 13:59:51 +0000 (14:59 +0100)]
Fix test (#591)

* Revert "Demoing zero-copy save. (#567)"

This reverts commit 4b3864c802d727be3cd67e5107a0f873d047ae69.

* Fixing the test and removing the PyBuffer thing.

* Remove features from bench.

20 months agoFix test (#590)
Nicolas Patry [Mon, 17 Mar 2025 10:58:03 +0000 (11:58 +0100)]
Fix test (#590)

* Revert "Demoing zero-copy save. (#567)"

This reverts commit 4b3864c802d727be3cd67e5107a0f873d047ae69.

* Fixing the test and removing the PyBuffer thing.

* Remove features from bench.

20 months agoMaking py311 the default. (#589)
Nicolas Patry [Mon, 17 Mar 2025 09:26:58 +0000 (10:26 +0100)]
Making py311 the default. (#589)

* Making py311 the default.

* Fixing release script.

* No default features everywhere.

20 months agoPass device to torch.asarray in get_tensor (#588)
Mick van Gelderen [Mon, 17 Mar 2025 09:14:17 +0000 (02:14 -0700)]
Pass device to torch.asarray in get_tensor (#588)

* Pass device to torch.asarray in get_tensor

* Fixing default device.

---------

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
20 months agoAdd onnx-safetensors to the projects list (#581)
Justin Chu [Thu, 13 Mar 2025 12:27:20 +0000 (05:27 -0700)]
Add onnx-safetensors to the projects list (#581)

onnx-safetensors enables onnx files to use safetensors as external data for the ONNX model natively.

20 months agofix(benchmark.rs): "serialize" and "deserialize" (#585)
Marco-Christiani [Thu, 13 Mar 2025 12:26:55 +0000 (08:26 -0400)]
fix(benchmark.rs): "serialize" and "deserialize" (#585)

20 months agoUpdating python bench ? (#587)
Nicolas Patry [Wed, 5 Mar 2025 16:46:19 +0000 (17:46 +0100)]
Updating python bench ? (#587)

* Updating python bench ?

* Cache v4??

20 months agoload_file: load tensors ordered by their offsets (#571)
Yousong Zhou [Wed, 5 Mar 2025 16:23:12 +0000 (00:23 +0800)]
load_file: load tensors ordered by their offsets (#571)

20 months agoFixing benchmarks. (#580)
Nicolas Patry [Wed, 26 Feb 2025 11:18:23 +0000 (12:18 +0100)]
Fixing benchmarks. (#580)

* Fixing benchmarks.

* Fix test line.

20 months agoAdd safestructures to project list (#570)
Craig Chan [Wed, 26 Feb 2025 09:18:09 +0000 (04:18 -0500)]
Add safestructures to project list (#570)

21 months agohpu index (#578)
Ilyas Moutawwakil [Tue, 25 Feb 2025 11:11:12 +0000 (12:11 +0100)]
hpu index (#578)

21 months agoremoved DS_Store (#573)
spikedoanz [Sun, 23 Feb 2025 17:48:52 +0000 (12:48 -0500)]
removed DS_Store (#573)

21 months agoDemoing zero-copy save. (#567)
Nicolas Patry [Thu, 6 Feb 2025 11:53:30 +0000 (12:53 +0100)]
Demoing zero-copy save. (#567)

* Demoing zero-copy save.

* Fixing clippy issue.

* Some cleanup.

* Sdist doesn't require feature ?

* Incorrect clean.

* Clippy ?

* Sanity check

* Fixing the doc builder?

* Using pre-commit for quality.

* This should work.

* Clippy variant.

* pyfeature typo.

* Bypassing the necessity for an env ?

* Remove maturin.

* BigEndian fix.

* Only black.

* We need to check both features.

* ??

* Asking for readonly is not possible.

* Before the build.

* Fixing byte-endian?

21 months agoReturn error on out of range index (#565)
Oliver Ford [Tue, 4 Feb 2025 10:31:44 +0000 (10:31 +0000)]
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>
21 months agoRestore compatibility with Rust 1.74 (#563)
Christian Heimes [Tue, 4 Feb 2025 08:25:26 +0000 (09:25 +0100)]
Restore compatibility with Rust 1.74 (#563)

* Restore compatibility with Rust 1.74

PR #544 added support for `no_std` feature. The PR changed
`std::error::Error` to `core::error::Error`. The `core::error` trait was
stabilized in Rust 1.81, so the change bumped MSRV to 1.81. Before the
Python package built with Rust 1.66 and the `safetensors` create with
all features built with 1.74.

This commit restores compatibility with Rust 1.74 for `std` builds:

- `mixed_integer_ops` feature requires 1.66
- `half v2.4.1` requires 1.70
- `clap_lex v0.7.4` requires 1.74

I'm also adding `rust-version` to `Cargo.toml`, so cargo creates a
backwards compatible `Cargo.lock`. By default, Cargo >= 1.83 creates a
`v4` lock file, which is not compatible with Cargo < 1.78.

Signed-off-by: Christian Heimes <christian@python.org>
* Merging the test matrix.

---------

Signed-off-by: Christian Heimes <christian@python.org>
Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
21 months agoAdd support for Intel Gaudi hpu accelerators (#566)
Asaf Karnieli [Tue, 4 Feb 2025 08:06:26 +0000 (10:06 +0200)]
Add support for Intel Gaudi hpu accelerators (#566)

* Add support for Intel Gaudi hpu accelerators

* Fixing the `find_spec` dep.

* Fixing unused import.

---------

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
22 months agoUpdating the dev number. (#558)
Nicolas Patry [Thu, 9 Jan 2025 10:37:55 +0000 (11:37 +0100)]
Updating the dev number. (#558)

22 months agoFix wrong signature of `safe_open.__init__` in stub file (#557)
SunghwanShim [Wed, 8 Jan 2025 17:17:49 +0000 (02:17 +0900)]
Fix wrong signature of `safe_open.__init__`  in stub file (#557)

* fix: pyi binding bug

* Fixing the stubbing script (breaking change in PyO3).

---------

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
22 months agosupport no_std (#556)
ZC [Tue, 7 Jan 2025 11:48:53 +0000 (19:48 +0800)]
support no_std (#556)

* support no_std (#544)

* Simpler clippy check (no features in safetensors really).

---------

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
22 months agoFixing the stub? (#554)
Nicolas Patry [Thu, 2 Jan 2025 17:50:57 +0000 (18:50 +0100)]
Fixing the stub? (#554)

22 months agoMemory map as private pure copy. (#553)
Nicolas Patry [Thu, 2 Jan 2025 17:07:11 +0000 (18:07 +0100)]
Memory map as private pure copy. (#553)

22 months agoRevert "Upgrade version number. (#551)" (#552)
Nicolas Patry [Thu, 2 Jan 2025 15:36:55 +0000 (16:36 +0100)]
Revert "Upgrade version number. (#551)" (#552)

This reverts commit 4439b19e6394fbbbd8315741e33f13dc10cb458a.

22 months agoUpgrade version number. (#551)
Nicolas Patry [Thu, 2 Jan 2025 15:35:49 +0000 (16:35 +0100)]
Upgrade version number. (#551)

22 months agoUpgrade version number. (#550)
Nicolas Patry [Thu, 2 Jan 2025 15:29:22 +0000 (16:29 +0100)]
Upgrade version number. (#550)

* Upgrade version number.

* Adding dynamic property.

22 months agoUpgrading PyO3 to 0.23 (#543)
Ivan Carvalho [Thu, 2 Jan 2025 15:20:02 +0000 (10:20 -0500)]
Upgrading PyO3 to 0.23 (#543)

* Update pyo3 to 0.23 and remove calls to deprecated methods

* Implement IntoPyObject trait

* Migrate IntoPy to IntoPyObject for Device

* Remove into_py calls pt1

* Remove into_py calls pt2

* Remove into_py calls pt3

* Macos-12 is deprecated.

* Clippy.

* Remove codecov.

---------

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
22 months agoAdd support for mlu devices (#535)
huismiling [Thu, 2 Jan 2025 10:06:14 +0000 (18:06 +0800)]
Add support for mlu devices (#535)

2 years agoAttempt to fix bench + update TF + maturin abi3 CI. (#540)
Nicolas Patry [Thu, 7 Nov 2024 07:17:35 +0000 (15:17 +0800)]
Attempt to fix bench + update TF + maturin abi3 CI. (#540)

* Attempt to fix bench + update TF + maturin abi3 CI.

* Bench only on main

2 years agoTrying some new CI. (#539)
Nicolas Patry [Wed, 6 Nov 2024 15:10:38 +0000 (23:10 +0800)]
Trying some new CI. (#539)

* Trying some new CI.

* Not too new, thanks TF.

* Use the correct token.

2 years agoUpdate __init__.pyi (#533)
Darion [Tue, 8 Oct 2024 05:14:52 +0000 (01:14 -0400)]
Update __init__.pyi (#533)

small spelling error

2 years agoPrepare for 0.4.5 (#525)
Nicolas Patry [Thu, 5 Sep 2024 13:35:48 +0000 (15:35 +0200)]
Prepare for 0.4.5 (#525)

* Prepare for 0.4.5

* Write packages for s390x

* Fix repo location.

2 years agofix lifetimes, add tensors iterator (#518)
Georgijs [Thu, 5 Sep 2024 12:42:47 +0000 (05:42 -0700)]
fix lifetimes, add tensors iterator (#518)

* fix lifetimes, add tensors iterator

* add test for lifetimes

2 years agoUse id rather than modelId
Omar Sanseviero [Mon, 2 Sep 2024 13:34:08 +0000 (15:34 +0200)]
Use id rather than modelId

2 years agoForcing empty list/empty tuple behavior. (#514)
Nicolas Patry [Mon, 5 Aug 2024 12:20:18 +0000 (14:20 +0200)]
Forcing empty list/empty tuple behavior. (#514)

* Forcing empty list/empty tuple behavior.

* Tailscale.

* No tailscale anymore ?

* Do not push the package it's not necessary.

* Remove `Debug`.

2 years agoFixing release workflow. (#513)
Nicolas Patry [Mon, 5 Aug 2024 10:28:27 +0000 (12:28 +0200)]
Fixing release workflow. (#513)

2 years agoUpgrading the version. (#511)
Nicolas Patry [Mon, 5 Aug 2024 07:35:21 +0000 (09:35 +0200)]
Upgrading the version. (#511)

2 years agoRespects torch.device(0) new behavior without breaking backward compatibility (#509)
Nicolas Patry [Thu, 1 Aug 2024 15:07:06 +0000 (17:07 +0200)]
Respects torch.device(0) new behavior without breaking backward compatibility (#509)

* Respects torch.device(0) new behavior without breaking backward
compatibilty.

* Fixing anonymous device type, apparently number string is not ok.

2 years agoFixing zero-width tensor for in memory loading. (#510)
Nicolas Patry [Wed, 31 Jul 2024 12:30:40 +0000 (14:30 +0200)]
Fixing zero-width tensor for in memory loading. (#510)

2 years agoImproving bf16 tests (#507)
Nicolas Patry [Wed, 31 Jul 2024 08:07:44 +0000 (10:07 +0200)]
Improving bf16 tests (#507)

* Add mlx.

* Add flax.

* Yaml is possibly worse than XML at this point.

* .

* Fixing BF16+BigEndian+Torch on Torch > 2.1

* Fix macos-13 so Python 3.8 is supported.

* Clippy fix.

* Adding macos-latest (ARM) to the test suite.

* Fmt.

* Installing cargo audit.

* I.

* Fixing format.

* Update 2 locations.

* tf.random.normal

* Random normal flax

* Fixing flax test.

* Remove bool test for flax.

* Attempting to upgrade numpy version.

* Revert pyproject.toml

* Fixing bool test (PT).

* Fixing new ARM element of matrix.

* Install mlx on ARM.

* Ignoring flax on macos arm.

* No bfloat16 on mlx.

* Reference issue in code.

* Re-enabling jax tests ?

* Removing ARM+macos target.

* Irrelevant changes.

* Trying to debug remotely.

* Different logs.

* This isn't counterproductive dev speed.

* Install mlx on old non arm macos.

* Adding a clone ?

* Checking bfloat16 serialized values.

* Linter.

* Hopefully fixing the byteswapping.

* Run mlx only on Python 3.11.

* Yaml..

* Fixing MLX tests (making it optional/skipped unfortunately).

* Much better fix that doesn't depend on torch version.

* Cleaner escape for MLX.

* Fixing F8XXX dtypes too on big endians + torch.

* inplace actually modifies storage.

* Inplace for numpy requires new holding place.

2 years agoAdd support for xla devices (#494)
Eric Meier [Tue, 30 Jul 2024 17:29:22 +0000 (10:29 -0700)]
Add support for xla devices (#494)

* Add support for xla devices

* :broom:

2 years agofeat(ci): add trufflehog secrets detection (#484)
Luc Georges [Mon, 29 Jul 2024 16:52:41 +0000 (18:52 +0200)]
feat(ci): add trufflehog secrets detection (#484)

* feat(ci): add trufflehog secrets detection

* fix(ci): remove unnecessary permissions

2 years agoChange doc-builder workflow container (#508)
Mishig [Mon, 29 Jul 2024 10:17:45 +0000 (12:17 +0200)]
Change doc-builder workflow container (#508)

* Change doc-builder workflow container

* trigger the action

2 years agoRevert "Improving the bf16 tests for PT+TF. (#505)" (#506)
Nicolas Patry [Fri, 26 Jul 2024 10:04:48 +0000 (12:04 +0200)]
Revert "Improving the bf16 tests for PT+TF. (#505)" (#506)

This reverts commit 3bfe61321b1f6ad870685f92a600f87c10593ff2.

2 years agoImproving the bf16 tests for PT+TF. (#505)
Nicolas Patry [Fri, 26 Jul 2024 10:03:34 +0000 (12:03 +0200)]
Improving the bf16 tests for PT+TF. (#505)

2 years agoUpgrading Pyo3 0.22 (with gil-refs) (#504)
Nicolas Patry [Thu, 25 Jul 2024 12:42:21 +0000 (14:42 +0200)]
Upgrading Pyo3 0.22 (with gil-refs) (#504)

* Upgrading Pyo3 0.22 (with gil-refs)

* Cleanup.

* Upgrading to 0.22

2 years agoMinor correction about Arrow in README.md (#488)
Quentin Lhoest [Thu, 18 Jul 2024 17:36:23 +0000 (19:36 +0200)]
Minor correction about Arrow in README.md (#488)

2 years agoFixing empty serialization (no tensor) with some metadata. (#472)
Nicolas Patry [Wed, 24 Apr 2024 08:24:00 +0000 (10:24 +0200)]
Fixing empty serialization (no tensor) with some metadata. (#472)

* Fixing empty serialization (no tensor) with some metadata.

* Fixing test value

* Add audit component.

* Install cargo audit.

2 years agoUpgrading pyo3 to 0.21. (#468)
Nicolas Patry [Mon, 15 Apr 2024 10:05:12 +0000 (12:05 +0200)]
Upgrading pyo3 to 0.21. (#468)

2 years agoAdd support for `device` in `safetensors.torch.load_model` (#449)
Lucain [Mon, 15 Apr 2024 07:50:22 +0000 (09:50 +0200)]
Add support for `device` in `safetensors.torch.load_model`  (#449)

* fix typo

* allow loading torch model to device

* fix device type

* update device type

2 years agoUpdating doc. (#465)
Nicolas Patry [Thu, 11 Apr 2024 08:04:18 +0000 (10:04 +0200)]
Updating doc. (#465)

2 years agoAdding support for integer indexing `[0, :2, -1]`. (#440)
Nicolas Patry [Fri, 16 Feb 2024 09:14:24 +0000 (10:14 +0100)]
Adding support for integer indexing `[0, :2, -1]`. (#440)

* Adding support for integer indexing `[0, :2, -1]`.

* Clean up error for too large indexing.

2 years agoUpdating minor after release 0.4.2 (#433)
Nicolas Patry [Tue, 23 Jan 2024 10:23:14 +0000 (11:23 +0100)]
Updating minor after release 0.4.2 (#433)

2 years agoRemove py313 windows. (#432)
Nicolas Patry [Tue, 23 Jan 2024 09:00:04 +0000 (10:00 +0100)]
Remove py313 windows. (#432)

* Remove py313 windows.

* Fix aarch+linux interpreter.

* Remove incorrect modification ?

2 years agoSkip MLX bench for the bench runner. (#429)
Nicolas Patry [Thu, 18 Jan 2024 16:53:37 +0000 (17:53 +0100)]
Skip MLX bench for the bench runner. (#429)

2 years agoAdd "xpu" device tag to the device list to support Intel GPU (#428)
Nicolas Patry [Thu, 18 Jan 2024 12:37:46 +0000 (13:37 +0100)]
Add "xpu" device tag to the device list to support Intel GPU (#428)

* Support XPU device

* Fmt.

---------

Co-authored-by: Jiong Gong <jiong.gong@intel.com>
2 years agoFix mispelling of dictionary. (#410)
Hayden Donnelly [Thu, 18 Jan 2024 12:36:38 +0000 (07:36 -0500)]
Fix mispelling of dictionary. (#410)

2 years agoImplement PyTorch support for float8 types (F8_E5M2 and F8_E4M3) (#404)
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

2 years agoFix missing Apache-2.0 license file in the published crate (#416)
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.

2 years agoRemoving old doc. (#427)
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.

2 years agoFix path in version_tag_suffix (#426)
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.

2 years ago[docs] Use `hfoptions` for metadata (#424)
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

2 years ago[docs, untested] Attempt to fix links to source (#420)
Pedro Cuenca [Mon, 8 Jan 2024 09:24:21 +0000 (10:24 +0100)]
[docs, untested] Attempt to fix links to source (#420)

2 years agoAdding MLX backend. (#419)
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>
2 years ago[docs] Update list of projects using safetensors (#418)
Mishig [Thu, 4 Jan 2024 11:00:24 +0000 (12:00 +0100)]
[docs] Update list of projects using safetensors (#418)

Add `mlx` & `candle`

2 years agoDocument `huggingface_hub.get_safetensors_metadata` (#417)
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>
2 years agoAdding stale action. (#398)
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.

3 years agoReleasing for python 3.12/3.13 and testing on 3.11. (#393)
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.

3 years agoFix/errors for some models including Mistral-7b and Flan-ul2 (#388)
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>
3 years agoUpgrade dev version. (#392)
Nicolas Patry [Mon, 27 Nov 2023 11:08:23 +0000 (12:08 +0100)]
Upgrade dev version. (#392)

3 years agoFix convert. (#390)
Nicolas Patry [Mon, 20 Nov 2023 10:22:45 +0000 (11:22 +0100)]
Fix convert. (#390)

3 years agoAdding support for Ascend NPU (#372)
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

3 years agoIgnore closed PRs to avoid spam. (#385)
Nicolas Patry [Fri, 17 Nov 2023 18:04:45 +0000 (19:04 +0100)]
Ignore closed PRs to avoid spam. (#385)

3 years agoBetter convert. (#384)
Nicolas Patry [Fri, 17 Nov 2023 17:28:16 +0000 (18:28 +0100)]
Better convert. (#384)

3 years agoSupport fp8_e4m3/fp8_e5m2 (#383)
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

3 years agoFix typo (#377)
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>