unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#73094] [PATCH 00/10] Add python-safetensors
@ 2024-09-07  9:36 Nicolas Graves via Guix-patches via
  2024-09-07 10:08 ` [bug#73094] [PATCH 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
                   ` (3 more replies)
  0 siblings, 4 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-07  9:36 UTC (permalink / raw)
  To: 73094; +Cc: ngraves

This patch series adds the package python-safetensors, which is a
prerequisite for packaging python-transformers.

Nicolas Graves (10):
  gnu: rust-darling-core-0.20: Update to 0.20.8.
  gnu: rust-darling-macro-0.20: Update to 0.20.8.
  gnu: rust-darling-0.20: Update to 0.20.8.
  gnu: Add rust-derive-builder-core-0.20.
  gnu: Add rust-derive-builder-macro-0.20.
  gnu: Add rust-derive-builder-0.20.
  gnu: Add rust-unicode-normalization-alignments-0.1.
  gnu: Add rust-rayon-cond-0.3.
  gnu: Add rust-safetensors.
  gnu: Add python-safetensors.

 gnu/packages/crates-io.scm        | 155 +++++++++++++++++++++++++-----
 gnu/packages/machine-learning.scm | 129 ++++++++++++++++++++++++-
 2 files changed, 257 insertions(+), 27 deletions(-)

-- 
2.45.2





^ permalink raw reply	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8.
  2024-09-07  9:36 [bug#73094] [PATCH 00/10] Add python-safetensors Nicolas Graves via Guix-patches via
@ 2024-09-07 10:08 ` Nicolas Graves via Guix-patches via
  2024-09-07 10:08   ` [bug#73094] [PATCH 02/10] gnu: rust-darling-macro-0.20: " Nicolas Graves via Guix-patches via
                     ` (8 more replies)
  2024-09-08 12:46 ` [bug#73094] [PATCH 00/10] " Herman Rimm via Guix-patches via
                   ` (2 subsequent siblings)
  3 siblings, 9 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-07 10:08 UTC (permalink / raw)
  To: 73094; +Cc: ngraves

* gnu/packages/crates-io.scm (rust-darling-core-0.20): Update to 0.20.8.

Change-Id: I7cef57f0aea51665e5c15843764be2304601f2a5
---
 gnu/packages/crates-io.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 0cdb071ea0..3fa0adda14 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -19290,7 +19290,7 @@ (define-public rust-darling-0.9
 (define-public rust-darling-core-0.20
   (package
     (name "rust-darling-core")
-    (version "0.20.3")
+    (version "0.20.8")
     (source
      (origin
        (method url-fetch)
@@ -19298,7 +19298,7 @@ (define-public rust-darling-core-0.20
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32
-         "08g6afi3z9jgcqx7g41s1mzr6q3dj2z56vz7v1bv6941h51k8zhp"))))
+         "03x7s149p06xfwcq0lgkk4yxh6jf7jckny18nzp1yyk87b1g2b4w"))))
     (build-system cargo-build-system)
     (arguments
      `(#:skip-build? #t
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH 02/10] gnu: rust-darling-macro-0.20: Update to 0.20.8.
  2024-09-07 10:08 ` [bug#73094] [PATCH 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
@ 2024-09-07 10:08   ` Nicolas Graves via Guix-patches via
  2024-09-07 10:08   ` [bug#73094] [PATCH 03/10] gnu: rust-darling-0.20: " Nicolas Graves via Guix-patches via
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-07 10:08 UTC (permalink / raw)
  To: 73094; +Cc: ngraves

* gnu/packages/crates-io.scm (rust-darling-macro-0.20): Update to
0.20.8.
  [origin](uri): Rename to darling_macro.

Change-Id: Ic46f41b26e5fa918f222256b1c6047cfe0dba790
---
 gnu/packages/crates-io.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 3fa0adda14..de2636709a 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -19421,15 +19421,15 @@ (define-public rust-darling-core-0.9
 (define-public rust-darling-macro-0.20
   (package
     (name "rust-darling-macro")
-    (version "0.20.3")
+    (version "0.20.8")
     (source
      (origin
        (method url-fetch)
-       (uri (crate-uri "darling-macro" version))
+       (uri (crate-uri "darling_macro" version))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32
-         "1mg2k1f0v33s271lpn4m5mxcfjqnmg61bf77svb44cyngay9nsl3"))))
+         "0gwkz0cjfy3fgcc1zmm7azzhj5qpja34s0cklcria4l38sjyss56"))))
     (build-system cargo-build-system)
     (arguments
      `(#:skip-build? #t
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH 03/10] gnu: rust-darling-0.20: Update to 0.20.8.
  2024-09-07 10:08 ` [bug#73094] [PATCH 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
  2024-09-07 10:08   ` [bug#73094] [PATCH 02/10] gnu: rust-darling-macro-0.20: " Nicolas Graves via Guix-patches via
@ 2024-09-07 10:08   ` Nicolas Graves via Guix-patches via
  2024-09-07 10:08   ` [bug#73094] [PATCH 04/10] gnu: Add rust-derive-builder-core-0.20 Nicolas Graves via Guix-patches via
                     ` (6 subsequent siblings)
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-07 10:08 UTC (permalink / raw)
  To: 73094; +Cc: ngraves

* gnu/packages/crates-io.scm (rust-darling-0.20): Update to 0.20.8.

Change-Id: Ib6569c26d6d74518a7069c1a5b89b60b67b8a152
---
 gnu/packages/crates-io.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index de2636709a..937923774e 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -19153,7 +19153,7 @@ (define-public rust-daemonize-0.4
 (define-public rust-darling-0.20
   (package
     (name "rust-darling")
-    (version "0.20.3")
+    (version "0.20.8")
     (source
      (origin
        (method url-fetch)
@@ -19161,7 +19161,7 @@ (define-public rust-darling-0.20
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32
-         "0pjwwadwgnvvgn5qm3glpv7hjl7siaqqpw6cvh2mdar7lr6xj282"))))
+         "14a38qsi9104kvk1z11rqj0bnz1866dyhnvgvbgzz17d2g6nzqsl"))))
     (build-system cargo-build-system)
     (arguments
      `(#:skip-build? #t
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH 04/10] gnu: Add rust-derive-builder-core-0.20.
  2024-09-07 10:08 ` [bug#73094] [PATCH 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
  2024-09-07 10:08   ` [bug#73094] [PATCH 02/10] gnu: rust-darling-macro-0.20: " Nicolas Graves via Guix-patches via
  2024-09-07 10:08   ` [bug#73094] [PATCH 03/10] gnu: rust-darling-0.20: " Nicolas Graves via Guix-patches via
@ 2024-09-07 10:08   ` Nicolas Graves via Guix-patches via
  2024-09-07 10:08   ` [bug#73094] [PATCH 05/10] gnu: Add rust-derive-builder-macro-0.20 Nicolas Graves via Guix-patches via
                     ` (5 subsequent siblings)
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-07 10:08 UTC (permalink / raw)
  To: 73094; +Cc: ngraves

* gnu/packages/crates-io.scm (rust-derive-builder-core-0.20): New
variable.
  (rust-derive-builder-core-0.13): Inherit from
  rust-derive-builder-core-0.20.

Change-Id: I3a6ee4eaf1ddc00aa8e131bdc59f11d8ad54208c
---
 gnu/packages/crates-io.scm | 34 +++++++++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 937923774e..2f84c0c107 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -20687,8 +20687,34 @@ (define-public rust-derive-builder-0.7
          ("rust-skeptic" ,rust-skeptic-0.13)
          ("rust-syn" ,rust-syn-0.15))))))
 
+(define-public rust-derive-builder-core-0.20
+  (package
+    (name "rust-derive-builder-core")
+    (version "0.20.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "derive_builder_core" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "0f5fg9cc9y53fx1fm4bh0s1yxwvc7v1zsircy8s054hkjq2glcbl"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-darling" ,rust-darling-0.20)
+                       ("rust-proc-macro2" ,rust-proc-macro2-1)
+                       ("rust-quote" ,rust-quote-1)
+                       ("rust-syn" ,rust-syn-2))
+       #:cargo-development-inputs
+       (("rust-pretty-assertions" ,rust-pretty-assertions-1))))
+    (home-page "https://github.com/colin-kiegel/rust-derive-builder")
+    (synopsis "Internal helper library for @code{rust-derive-builder}")
+    (description
+     "Internal helper library for @code{rust-derive-builder}.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public rust-derive-builder-core-0.13
   (package
+    (inherit rust-derive-builder-core-0.20)
     (name "rust-derive-builder-core")
     (version "0.13.1")
     (source (origin
@@ -20698,19 +20724,13 @@ (define-public rust-derive-builder-core-0.13
               (sha256
                (base32
                 "1381dgjq6jhirww088dff8b00v2d99illvnan0l0kvz7qdy33v54"))))
-    (build-system cargo-build-system)
     (arguments
      `(#:cargo-inputs (("rust-darling" ,rust-darling-0.14)
                        ("rust-proc-macro2" ,rust-proc-macro2-1)
                        ("rust-quote" ,rust-quote-1)
                        ("rust-syn" ,rust-syn-1))
        #:cargo-development-inputs
-       (("rust-pretty-assertions" ,rust-pretty-assertions-1))))
-    (home-page "https://github.com/colin-kiegel/rust-derive-builder")
-    (synopsis "Internal helper library for @code{rust-derive-builder}")
-    (description
-     "Internal helper library for @code{rust-derive-builder}.")
-    (license (list license:expat license:asl2.0))))
+       (("rust-pretty-assertions" ,rust-pretty-assertions-1))))))
 
 (define-public rust-derive-builder-core-0.12
   (package
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH 05/10] gnu: Add rust-derive-builder-macro-0.20.
  2024-09-07 10:08 ` [bug#73094] [PATCH 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
                     ` (2 preceding siblings ...)
  2024-09-07 10:08   ` [bug#73094] [PATCH 04/10] gnu: Add rust-derive-builder-core-0.20 Nicolas Graves via Guix-patches via
@ 2024-09-07 10:08   ` Nicolas Graves via Guix-patches via
  2024-09-07 10:08   ` [bug#73094] [PATCH 06/10] gnu: Add rust-derive-builder-0.20 Nicolas Graves via Guix-patches via
                     ` (4 subsequent siblings)
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-07 10:08 UTC (permalink / raw)
  To: 73094; +Cc: ngraves

* gnu/packages/crates-io.scm (rust-derive-builder-macro-0.20): New
variable.
  (rust-derive-builder-macro-0.13): Inherit from
  rust-derive-builder-macro-0.20.

Change-Id: I7d39f3638c233c61f3ee29a2d107cc0e154a0246
---
 gnu/packages/crates-io.scm | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 2f84c0c107..87369c5b98 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -20840,8 +20840,31 @@ (define-public rust-derive-builder-core-0.5
          ("rust-quote" ,rust-quote-0.6)
          ("rust-syn" ,rust-syn-0.15))))))
 
+(define-public rust-derive-builder-macro-0.20
+  (package
+    (name "rust-derive-builder-macro")
+    (version "0.20.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "derive_builder_macro" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1p2ijj442j30cvd1x5231jw8b4klyf65sl3rnxvri6zpbc1ygfja"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-derive-builder-core" ,rust-derive-builder-core-0.20)
+                       ("rust-syn" ,rust-syn-1))))
+    (home-page "https://github.com/colin-kiegel/rust-derive-builder")
+    (synopsis "Automatically implement the builder pattern for arbitrary structs")
+    (description
+     "This crate provides a Rust macro to automatically implement the builder
+pattern for arbitrary structs.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public rust-derive-builder-macro-0.13
   (package
+    (inherit rust-derive-builder-macro-0.20)
     (name "rust-derive-builder-macro")
     (version "0.13.1")
     (source (origin
@@ -20851,16 +20874,9 @@ (define-public rust-derive-builder-macro-0.13
               (sha256
                (base32
                 "09q17rzgf8bsj8n1bhlf4f93nmqg8va6321ppcd07f1mzg1nh0w7"))))
-    (build-system cargo-build-system)
     (arguments
      `(#:cargo-inputs (("rust-derive-builder-core" ,rust-derive-builder-core-0.13)
-                       ("rust-syn" ,rust-syn-1))))
-    (home-page "https://github.com/colin-kiegel/rust-derive-builder")
-    (synopsis "Automatically implement the builder pattern for arbitrary structs")
-    (description
-     "This crate provides a Rust macro to automatically implement the builder
-pattern for arbitrary structs.")
-    (license (list license:expat license:asl2.0))))
+                       ("rust-syn" ,rust-syn-1))))))
 
 (define-public rust-derive-builder-macro-0.12
   (package
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH 06/10] gnu: Add rust-derive-builder-0.20.
  2024-09-07 10:08 ` [bug#73094] [PATCH 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
                     ` (3 preceding siblings ...)
  2024-09-07 10:08   ` [bug#73094] [PATCH 05/10] gnu: Add rust-derive-builder-macro-0.20 Nicolas Graves via Guix-patches via
@ 2024-09-07 10:08   ` Nicolas Graves via Guix-patches via
  2024-09-07 10:08   ` [bug#73094] [PATCH 07/10] gnu: Add rust-unicode-normalization-alignments-0.1 Nicolas Graves via Guix-patches via
                     ` (3 subsequent siblings)
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-07 10:08 UTC (permalink / raw)
  To: 73094; +Cc: ngraves

* gnu/packages/crates-io.scm (rust-derive-builder-0.20): New variable.
(rust-derive-builder-0.13): Inherit form rust-derive-builder-0.20.

Change-Id: I8d237c591872fd01605cdf73d19bc085b4a7ea6f
---
 gnu/packages/crates-io.scm | 30 ++++++++++++++++++++++++++----
 1 file changed, 26 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 87369c5b98..8f37f19f58 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -20551,21 +20551,21 @@ (define-public rust-derive-arbitrary-0.4
                        ("rust-quote" ,rust-quote-1)
                        ("rust-syn" ,rust-syn-1))))))
 
-(define-public rust-derive-builder-0.13
+(define-public rust-derive-builder-0.20
   (package
     (name "rust-derive-builder")
-    (version "0.13.1")
+    (version "0.20.1")
     (source (origin
               (method url-fetch)
               (uri (crate-uri "derive_builder" version))
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "1irqx6bz74kx48ivdwqp2xl1ibr8dbdwgh6573r8g00d82gicncg"))))
+                "0yw7frfcgza5rm7f1ckrsy1qy0i6gim3blw12xm186d1wrzg6cyd"))))
     (build-system cargo-build-system)
     (arguments
      `(#:cargo-inputs
-       (("rust-derive-builder-macro" ,rust-derive-builder-macro-0.13))
+       (("rust-derive-builder-macro" ,rust-derive-builder-macro-0.20))
        #:cargo-development-inputs
        (("rust-pretty-assertions" ,rust-pretty-assertions-0.6)
         ("rust-rustversion" ,rust-rustversion-1)
@@ -20578,6 +20578,28 @@ (define-public rust-derive-builder-0.13
 for arbitrary structs.")
     (license (list license:expat license:asl2.0))))
 
+(define-public rust-derive-builder-0.13
+  (package
+    (inherit rust-derive-builder-0.20)
+    (name "rust-derive-builder")
+    (version "0.13.1")
+    (source (origin
+              (method url-fetch)
+              (uri (crate-uri "derive_builder" version))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1irqx6bz74kx48ivdwqp2xl1ibr8dbdwgh6573r8g00d82gicncg"))))
+    (arguments
+     `(#:cargo-inputs
+       (("rust-derive-builder-macro" ,rust-derive-builder-macro-0.13))
+       #:cargo-development-inputs
+       (("rust-pretty-assertions" ,rust-pretty-assertions-0.6)
+        ("rust-rustversion" ,rust-rustversion-1)
+        ("rust-serde" ,rust-serde-1)
+        ("rust-serde-json" ,rust-serde-json-1)
+        ("rust-trybuild" ,rust-trybuild-1))))))
+
 (define-public rust-derive-builder-0.12
   (package
     (inherit rust-derive-builder-0.13)
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH 07/10] gnu: Add rust-unicode-normalization-alignments-0.1.
  2024-09-07 10:08 ` [bug#73094] [PATCH 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
                     ` (4 preceding siblings ...)
  2024-09-07 10:08   ` [bug#73094] [PATCH 06/10] gnu: Add rust-derive-builder-0.20 Nicolas Graves via Guix-patches via
@ 2024-09-07 10:08   ` Nicolas Graves via Guix-patches via
  2024-09-07 10:08   ` [bug#73094] [PATCH 08/10] gnu: Add rust-rayon-cond-0.3 Nicolas Graves via Guix-patches via
                     ` (2 subsequent siblings)
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-07 10:08 UTC (permalink / raw)
  To: 73094; +Cc: ngraves

* gnu/packages/crates-io.scm (rust-unicode-normalization-alignments-0.1): New variable.

Change-Id: I338fd9a00affd1d83ace8356b6276fda476a68c8
---
 gnu/packages/crates-io.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 8f37f19f58..cebb27a408 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -86733,6 +86733,28 @@ (define-public rust-unicode-normalization-0.1
 described in Unicode Standard Annex #15.")
     (license (list license:expat license:asl2.0))))
 
+(define-public rust-unicode-normalization-alignments-0.1
+  (package
+    (name "rust-unicode-normalization-alignments")
+    (version "0.1.12")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "unicode-normalization-alignments" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1pk2f3arh3qvdsmrsiri0gr5y5vqpk2gv1yjin0njvh4zbj17xj3"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-smallvec" ,rust-smallvec-1))))
+    (home-page "https://github.com/n1t0/unicode-normalization")
+    (synopsis "Normalize Unicode strings ")
+    (description
+     "This crate provides functions for normalization of Unicode strings, including
+Canonical and Compatible Decomposition and Recomposition, as described in
+Unicode Standard Annex #15.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public rust-unicode-reverse-1
   (package
     (name "rust-unicode-reverse")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH 08/10] gnu: Add rust-rayon-cond-0.3.
  2024-09-07 10:08 ` [bug#73094] [PATCH 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
                     ` (5 preceding siblings ...)
  2024-09-07 10:08   ` [bug#73094] [PATCH 07/10] gnu: Add rust-unicode-normalization-alignments-0.1 Nicolas Graves via Guix-patches via
@ 2024-09-07 10:08   ` Nicolas Graves via Guix-patches via
  2024-09-07 10:08   ` [bug#73094] [PATCH 09/10] gnu: Add rust-safetensors Nicolas Graves via Guix-patches via
  2024-09-07 10:08   ` [bug#73094] [PATCH 10/10] gnu: Add python-safetensors Nicolas Graves via Guix-patches via
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-07 10:08 UTC (permalink / raw)
  To: 73094; +Cc: ngraves

* gnu/packages/crates-io.scm (rust-rayon-cond-0.3): New variable.

Change-Id: I2683b5cb5c698380cd9485b0a6f090f827678c4d
---
 gnu/packages/crates-io.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index cebb27a408..36ecbe4430 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -61807,6 +61807,29 @@ (define-public rust-rawkey-0.1
      "This package provides support for raw key input in terminals.")
     (license license:expat)))
 
+(define-public rust-rayon-cond-0.3
+  (package
+    (name "rust-rayon-cond")
+    (version "0.3.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "rayon-cond" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1ybxppq84p3q60h9rng9j3dm79f6970hn4wljyf31lpgan5m77q5"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-either" ,rust-either-1)
+                       ("rust-itertools" ,rust-itertools-0.11)
+                       ("rust-rayon" ,rust-rayon-1))))
+    (home-page "https://github.com/cuviper/rayon-cond")
+    (synopsis "Experimental iterator wrapper")
+    (description
+     "This package provides a Rust experimental iterator wrapper that is
+conditionally parallel or serial.")
+    (license (list license:asl2.0 license:expat))))
+
 (define-public rust-rayon-core-1
   (package
     (name "rust-rayon-core")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH 09/10] gnu: Add rust-safetensors.
  2024-09-07 10:08 ` [bug#73094] [PATCH 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
                     ` (6 preceding siblings ...)
  2024-09-07 10:08   ` [bug#73094] [PATCH 08/10] gnu: Add rust-rayon-cond-0.3 Nicolas Graves via Guix-patches via
@ 2024-09-07 10:08   ` Nicolas Graves via Guix-patches via
  2024-09-07 10:08   ` [bug#73094] [PATCH 10/10] gnu: Add python-safetensors Nicolas Graves via Guix-patches via
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-07 10:08 UTC (permalink / raw)
  To: 73094; +Cc: ngraves

* gnu/packages/machine-learning.scm (rust-safetensors): New variable.

Change-Id: I2733dbae90b292ed6485666cf875d6fb899c5d12
---
 gnu/packages/machine-learning.scm | 32 ++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index d9a02b7093..a4aeb97be7 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -17,7 +17,7 @@
 ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
 ;;; Copyright © 2020, 2021, 2022, 2023, 2024 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
-;;; Copyright © 2022, 2023 Nicolas Graves <ngraves@ngraves.fr>
+;;; Copyright © 2022, 2023, 2024 Nicolas Graves <ngraves@ngraves.fr>
 ;;; Copyright © 2022 Kiran Shila <me@kiranshila.com>
 ;;; Copyright © 2023 zamfofex <zamfofex@twdb.moe>
 ;;; Copyright © 2023 Navid Afkhami <navid.afkhami@mdc-berlin.de>
@@ -52,6 +52,7 @@ (define-module (gnu packages machine-learning)
   #:use-module (guix utils)
   #:use-module (guix download)
   #:use-module (guix svn-download)
+  #:use-module (guix build-system cargo)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system copy)
   #:use-module (guix build-system gnu)
@@ -77,6 +78,7 @@ (define-module (gnu packages machine-learning)
   #:use-module (gnu packages cmake)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages cran)
+  #:use-module (gnu packages crates-io)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages dejagnu)
   #:use-module (gnu packages documentation)
@@ -1090,6 +1092,34 @@ (define-public python-sacrebleu
 and reproducible BLEU, chrF, and TER scores for natural language processing.")
     (license license:asl2.0)))
 
+(define-public rust-safetensors
+  (package
+    (name "rust-safetensors")
+    (version "0.4.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "safetensors" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1fbx56wikqcvqb4y0ym0cys68lj0v3cpanhsy5i13fkz5jr7dvcc"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs
+       (("rust-serde" ,rust-serde-1)
+        ("rust-serde-json" ,rust-serde-json-1))
+       #:cargo-development-inputs
+       (("rust-criterion" ,rust-criterion-0.5)
+        ("rust-memmap2" ,rust-memmap2-0.9)
+        ("rust-proptest" ,rust-proptest-1))))
+    (home-page "https://github.com/huggingface/safetensors")
+    (synopsis "Simple and safe way to store and distribute tensors")
+    (description
+     "This package provides a fast (zero-copy) and safe (dedicated) format for
+storing tensors safely, named safetensors.  They aim to be safer than their
+@code{PyTorch} counterparts.")
+    (license license:asl2.0)))
+
 (define-public python-sentencepiece
   (package
     (name "python-sentencepiece")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH 10/10] gnu: Add python-safetensors.
  2024-09-07 10:08 ` [bug#73094] [PATCH 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
                     ` (7 preceding siblings ...)
  2024-09-07 10:08   ` [bug#73094] [PATCH 09/10] gnu: Add rust-safetensors Nicolas Graves via Guix-patches via
@ 2024-09-07 10:08   ` Nicolas Graves via Guix-patches via
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-07 10:08 UTC (permalink / raw)
  To: 73094; +Cc: ngraves

* gnu/packages/machine-learning.scm (python-safetensors): New variable.

Change-Id: I90a1684d06756ce87ca0862d745a75be5919f0b2
---
 gnu/packages/machine-learning.scm | 97 +++++++++++++++++++++++++++++++
 1 file changed, 97 insertions(+)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index a4aeb97be7..12be1d7bf6 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1120,6 +1120,103 @@ (define-public rust-safetensors
 @code{PyTorch} counterparts.")
     (license license:asl2.0)))
 
+(define-public python-safetensors
+  (package
+    (name "python-safetensors")
+    (version "0.4.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "safetensors" version))
+       (sha256
+        (base32 "1hhiwy67jarm70l0k26fs1cjhzkgzrh79q14bklj2yp0qi8gr19g"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)))
+       (snippet
+        #~(begin  ;; Only keeping bindings.
+            (for-each (lambda (file)
+                        (unless (member file '("." ".." "bindings" "PKG-INFO"))
+                          (delete-file-recursively file)))
+                      (scandir "."))
+            (for-each (lambda (file)
+                        (unless (member file '("." ".."))
+                          (rename-file (string-append "bindings/python/" file) file)))
+                      (scandir "bindings/python"))))))
+    (build-system cargo-build-system)
+    (arguments
+     (list
+      #:imported-modules `(,@%cargo-build-system-modules
+                           ,@%pyproject-build-system-modules)
+      #:modules '((guix build cargo-build-system)
+                  ((guix build pyproject-build-system) #:prefix py:)
+                  (guix build utils)
+                  (ice-9 regex)
+                  (ice-9 textual-ports))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack-rust-crates 'inject-safetensors
+            (lambda _
+              (substitute* "Cargo.toml"
+                (("\\[dependencies\\]")
+                 (format #f "[dependencies]~%safetensors = ~s"
+                         #$(package-version rust-safetensors))))
+              (let ((file-path "Cargo.toml"))
+                (call-with-input-file file-path
+                  (lambda (port)
+                    (let* ((content (get-string-all port))
+                           (top-match (string-match
+                                       "\\[dependencies.safetensors" content)))
+                      (call-with-output-file file-path
+                        (lambda (out)
+                          (format out "~a" (match:prefix top-match))))))))))
+          (replace 'check
+            (lambda _
+              (copy-file "target/release/libsafetensors_rust.so"
+                         "py_src/safetensors/_safetensors_rust.so")
+              (invoke "python3"
+                      "-c" (format #f
+                                   "import sys; sys.path.append(\"~a/py_src\")"
+                                   (getcwd))
+                      "-m" "pytest"
+                      "-n" "auto"
+                      "--dist=loadfile"
+                      "-s" "-v" "./tests/"
+                      "--ignore=./tests/test_flax_comparison.py")))
+          (add-after 'install 'install-python
+            (lambda _
+              (let* ((pversion #$(version-major+minor (package-version python)))
+                     (lib (string-append #$output "/lib/python" pversion
+                                         "/site-packages/"))
+                     (info (string-append lib "safetensors-"
+                                        #$(package-version this-package)
+                                        ".dist-info")))
+                (mkdir-p info)
+                (copy-file "PKG-INFO" (string-append info "/METADATA"))
+                (copy-recursively
+                 "py_src/safetensors"
+                 (string-append lib "safetensors"))))))
+      #:cargo-inputs
+      `(("rust-pyo3" ,rust-pyo3-0.21)
+        ("rust-memmap2" ,rust-memmap2-0.9)
+        ("rust-safetensors" ,rust-safetensors)
+        ("rust-serde-json" ,rust-serde-json-1))))
+    (inputs
+     (list rust-safetensors))
+    (native-inputs
+     (list python-h5py
+           python-minimal
+           python-numpy
+           python-pytest
+           python-pytest-xdist
+           python-pytorch
+           tensorflow))
+    (home-page "https://huggingface.co/docs/safetensors")
+    (synopsis "Simple and safe way to store and distribute tensors")
+    (description "This package provides a fast (zero-copy) and safe
+(dedicated) format for storing tensors safely.  This package builds upon
+@code{rust-safetensors} and provides Python bindings.")
+    (license license:asl2.0)))
+
 (define-public python-sentencepiece
   (package
     (name "python-sentencepiece")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH 00/10] Add python-safetensors
  2024-09-07  9:36 [bug#73094] [PATCH 00/10] Add python-safetensors Nicolas Graves via Guix-patches via
  2024-09-07 10:08 ` [bug#73094] [PATCH 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
@ 2024-09-08 12:46 ` Herman Rimm via Guix-patches via
  2024-09-08 14:39 ` [bug#73094] [PATCH v2 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
  2024-09-09 10:07 ` [bug#73094] [PATCH v3 00/10] " Herman Rimm via Guix-patches via
  3 siblings, 0 replies; 33+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-09-08 12:46 UTC (permalink / raw)
  To: 73094; +Cc: Nicolas Graves

Hello Nicholas,

python-safetensors builds fine.  Can you reduce the indentation of the
snippet, and remove the (let ((file-path "Cargo.toml")) in arguments?

I think the development-inputs for rust-darling are up to date, so for
patch #3 you could try:

-     `(#:skip-build? #t
+     `(#:cargo-development-inputs
+       (("rust-proc-macro2" ,rust-proc-macro2-1)
+        ("rust-quote" ,rust-quote-1)
+        ("rust-rustversion" ,rust-rustversion-1)
+        ("rust-syn" ,rust-syn-2)
+        ("rust-trybuild" ,rust-trybuild-1))

Also try enabling the build for patches #1 and #2.  The other patches
look OK.

Cheers,
Herman




^ permalink raw reply	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v2 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8.
  2024-09-07  9:36 [bug#73094] [PATCH 00/10] Add python-safetensors Nicolas Graves via Guix-patches via
  2024-09-07 10:08 ` [bug#73094] [PATCH 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
  2024-09-08 12:46 ` [bug#73094] [PATCH 00/10] " Herman Rimm via Guix-patches via
@ 2024-09-08 14:39 ` Nicolas Graves via Guix-patches via
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 02/10] gnu: rust-darling-macro-0.20: " Nicolas Graves via Guix-patches via
                     ` (8 more replies)
  2024-09-09 10:07 ` [bug#73094] [PATCH v3 00/10] " Herman Rimm via Guix-patches via
  3 siblings, 9 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-08 14:39 UTC (permalink / raw)
  To: 73094; +Cc: herman, ngraves

* gnu/packages/crates-io.scm (rust-darling-core-0.20): Update to 0.20.8.
[arguments]<#:skip-build?>: Set to #f.

Change-Id: I7cef57f0aea51665e5c15843764be2304601f2a5
---
 gnu/packages/crates-io.scm | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 0cdb071ea0..f6833b7707 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -19290,7 +19290,7 @@ (define-public rust-darling-0.9
 (define-public rust-darling-core-0.20
   (package
     (name "rust-darling-core")
-    (version "0.20.3")
+    (version "0.20.8")
     (source
      (origin
        (method url-fetch)
@@ -19298,11 +19298,10 @@ (define-public rust-darling-core-0.20
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32
-         "08g6afi3z9jgcqx7g41s1mzr6q3dj2z56vz7v1bv6941h51k8zhp"))))
+         "03x7s149p06xfwcq0lgkk4yxh6jf7jckny18nzp1yyk87b1g2b4w"))))
     (build-system cargo-build-system)
     (arguments
-     `(#:skip-build? #t
-       #:cargo-inputs
+     `(#:cargo-inputs
        (("rust-fnv" ,rust-fnv-1)
         ("rust-ident-case" ,rust-ident-case-1)
         ("rust-proc-macro2" ,rust-proc-macro2-1)
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v2 02/10] gnu: rust-darling-macro-0.20: Update to 0.20.8.
  2024-09-08 14:39 ` [bug#73094] [PATCH v2 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
@ 2024-09-08 14:39   ` Nicolas Graves via Guix-patches via
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 03/10] gnu: rust-darling-0.20: " Nicolas Graves via Guix-patches via
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-08 14:39 UTC (permalink / raw)
  To: 73094; +Cc: herman, ngraves

* gnu/packages/crates-io.scm (rust-darling-macro-0.20): Update to
0.20.8.
  [origin](uri): Rename to darling_macro.
  [arguments]<#:skip-build?>: Set to #f.

Change-Id: Ic46f41b26e5fa918f222256b1c6047cfe0dba790
---
 gnu/packages/crates-io.scm | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index f6833b7707..e7693c64ea 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -19420,19 +19420,18 @@ (define-public rust-darling-core-0.9
 (define-public rust-darling-macro-0.20
   (package
     (name "rust-darling-macro")
-    (version "0.20.3")
+    (version "0.20.8")
     (source
      (origin
        (method url-fetch)
-       (uri (crate-uri "darling-macro" version))
+       (uri (crate-uri "darling_macro" version))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32
-         "1mg2k1f0v33s271lpn4m5mxcfjqnmg61bf77svb44cyngay9nsl3"))))
+         "0gwkz0cjfy3fgcc1zmm7azzhj5qpja34s0cklcria4l38sjyss56"))))
     (build-system cargo-build-system)
     (arguments
-     `(#:skip-build? #t
-       #:cargo-inputs
+     `(#:cargo-inputs
        (("rust-darling-core" ,rust-darling-core-0.20)
         ("rust-quote" ,rust-quote-1)
         ("rust-syn" ,rust-syn-2))))
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v2 03/10] gnu: rust-darling-0.20: Update to 0.20.8.
  2024-09-08 14:39 ` [bug#73094] [PATCH v2 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 02/10] gnu: rust-darling-macro-0.20: " Nicolas Graves via Guix-patches via
@ 2024-09-08 14:39   ` Nicolas Graves via Guix-patches via
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 04/10] gnu: Add rust-derive-builder-core-0.20 Nicolas Graves via Guix-patches via
                     ` (6 subsequent siblings)
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-08 14:39 UTC (permalink / raw)
  To: 73094; +Cc: herman, ngraves

* gnu/packages/crates-io.scm (rust-darling-0.20): Update to 0.20.8.
[arguments]<#:cargo-development-inputs>: Add rust-proc-macro2,
rust-quote, rust-rustversion, rust-syn, rust-trybuild.

Change-Id: Ib6569c26d6d74518a7069c1a5b89b60b67b8a152
---
 gnu/packages/crates-io.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index e7693c64ea..19f619c27c 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -19153,7 +19153,7 @@ (define-public rust-daemonize-0.4
 (define-public rust-darling-0.20
   (package
     (name "rust-darling")
-    (version "0.20.3")
+    (version "0.20.8")
     (source
      (origin
        (method url-fetch)
@@ -19161,10 +19161,15 @@ (define-public rust-darling-0.20
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32
-         "0pjwwadwgnvvgn5qm3glpv7hjl7siaqqpw6cvh2mdar7lr6xj282"))))
+         "14a38qsi9104kvk1z11rqj0bnz1866dyhnvgvbgzz17d2g6nzqsl"))))
     (build-system cargo-build-system)
     (arguments
-     `(#:skip-build? #t
+     `(#:cargo-development-inputs
+       (("rust-proc-macro2" ,rust-proc-macro2-1)
+        ("rust-quote" ,rust-quote-1)
+        ("rust-rustversion" ,rust-rustversion-1)
+        ("rust-syn" ,rust-syn-2)
+        ("rust-trybuild" ,rust-trybuild-1))
        #:cargo-inputs
        (("rust-darling-core" ,rust-darling-core-0.20)
         ("rust-darling-macro" ,rust-darling-macro-0.20))))
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v2 04/10] gnu: Add rust-derive-builder-core-0.20.
  2024-09-08 14:39 ` [bug#73094] [PATCH v2 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 02/10] gnu: rust-darling-macro-0.20: " Nicolas Graves via Guix-patches via
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 03/10] gnu: rust-darling-0.20: " Nicolas Graves via Guix-patches via
@ 2024-09-08 14:39   ` Nicolas Graves via Guix-patches via
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 05/10] gnu: Add rust-derive-builder-macro-0.20 Nicolas Graves via Guix-patches via
                     ` (5 subsequent siblings)
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-08 14:39 UTC (permalink / raw)
  To: 73094; +Cc: herman, ngraves

* gnu/packages/crates-io.scm (rust-derive-builder-core-0.20): New
variable.
  (rust-derive-builder-core-0.13): Inherit from
  rust-derive-builder-core-0.20.

Change-Id: I3a6ee4eaf1ddc00aa8e131bdc59f11d8ad54208c
---
 gnu/packages/crates-io.scm | 34 +++++++++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 19f619c27c..effc4393e5 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -20690,8 +20690,34 @@ (define-public rust-derive-builder-0.7
          ("rust-skeptic" ,rust-skeptic-0.13)
          ("rust-syn" ,rust-syn-0.15))))))
 
+(define-public rust-derive-builder-core-0.20
+  (package
+    (name "rust-derive-builder-core")
+    (version "0.20.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "derive_builder_core" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "0f5fg9cc9y53fx1fm4bh0s1yxwvc7v1zsircy8s054hkjq2glcbl"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-darling" ,rust-darling-0.20)
+                       ("rust-proc-macro2" ,rust-proc-macro2-1)
+                       ("rust-quote" ,rust-quote-1)
+                       ("rust-syn" ,rust-syn-2))
+       #:cargo-development-inputs
+       (("rust-pretty-assertions" ,rust-pretty-assertions-1))))
+    (home-page "https://github.com/colin-kiegel/rust-derive-builder")
+    (synopsis "Internal helper library for @code{rust-derive-builder}")
+    (description
+     "Internal helper library for @code{rust-derive-builder}.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public rust-derive-builder-core-0.13
   (package
+    (inherit rust-derive-builder-core-0.20)
     (name "rust-derive-builder-core")
     (version "0.13.1")
     (source (origin
@@ -20701,19 +20727,13 @@ (define-public rust-derive-builder-core-0.13
               (sha256
                (base32
                 "1381dgjq6jhirww088dff8b00v2d99illvnan0l0kvz7qdy33v54"))))
-    (build-system cargo-build-system)
     (arguments
      `(#:cargo-inputs (("rust-darling" ,rust-darling-0.14)
                        ("rust-proc-macro2" ,rust-proc-macro2-1)
                        ("rust-quote" ,rust-quote-1)
                        ("rust-syn" ,rust-syn-1))
        #:cargo-development-inputs
-       (("rust-pretty-assertions" ,rust-pretty-assertions-1))))
-    (home-page "https://github.com/colin-kiegel/rust-derive-builder")
-    (synopsis "Internal helper library for @code{rust-derive-builder}")
-    (description
-     "Internal helper library for @code{rust-derive-builder}.")
-    (license (list license:expat license:asl2.0))))
+       (("rust-pretty-assertions" ,rust-pretty-assertions-1))))))
 
 (define-public rust-derive-builder-core-0.12
   (package
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v2 05/10] gnu: Add rust-derive-builder-macro-0.20.
  2024-09-08 14:39 ` [bug#73094] [PATCH v2 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
                     ` (2 preceding siblings ...)
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 04/10] gnu: Add rust-derive-builder-core-0.20 Nicolas Graves via Guix-patches via
@ 2024-09-08 14:39   ` Nicolas Graves via Guix-patches via
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 06/10] gnu: Add rust-derive-builder-0.20 Nicolas Graves via Guix-patches via
                     ` (4 subsequent siblings)
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-08 14:39 UTC (permalink / raw)
  To: 73094; +Cc: herman, ngraves

* gnu/packages/crates-io.scm (rust-derive-builder-macro-0.20): New
variable.
  (rust-derive-builder-macro-0.13): Inherit from
  rust-derive-builder-macro-0.20.

Change-Id: I7d39f3638c233c61f3ee29a2d107cc0e154a0246
---
 gnu/packages/crates-io.scm | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index effc4393e5..97f955be12 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -20843,8 +20843,31 @@ (define-public rust-derive-builder-core-0.5
          ("rust-quote" ,rust-quote-0.6)
          ("rust-syn" ,rust-syn-0.15))))))
 
+(define-public rust-derive-builder-macro-0.20
+  (package
+    (name "rust-derive-builder-macro")
+    (version "0.20.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "derive_builder_macro" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1p2ijj442j30cvd1x5231jw8b4klyf65sl3rnxvri6zpbc1ygfja"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-derive-builder-core" ,rust-derive-builder-core-0.20)
+                       ("rust-syn" ,rust-syn-1))))
+    (home-page "https://github.com/colin-kiegel/rust-derive-builder")
+    (synopsis "Automatically implement the builder pattern for arbitrary structs")
+    (description
+     "This crate provides a Rust macro to automatically implement the builder
+pattern for arbitrary structs.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public rust-derive-builder-macro-0.13
   (package
+    (inherit rust-derive-builder-macro-0.20)
     (name "rust-derive-builder-macro")
     (version "0.13.1")
     (source (origin
@@ -20854,16 +20877,9 @@ (define-public rust-derive-builder-macro-0.13
               (sha256
                (base32
                 "09q17rzgf8bsj8n1bhlf4f93nmqg8va6321ppcd07f1mzg1nh0w7"))))
-    (build-system cargo-build-system)
     (arguments
      `(#:cargo-inputs (("rust-derive-builder-core" ,rust-derive-builder-core-0.13)
-                       ("rust-syn" ,rust-syn-1))))
-    (home-page "https://github.com/colin-kiegel/rust-derive-builder")
-    (synopsis "Automatically implement the builder pattern for arbitrary structs")
-    (description
-     "This crate provides a Rust macro to automatically implement the builder
-pattern for arbitrary structs.")
-    (license (list license:expat license:asl2.0))))
+                       ("rust-syn" ,rust-syn-1))))))
 
 (define-public rust-derive-builder-macro-0.12
   (package
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v2 06/10] gnu: Add rust-derive-builder-0.20.
  2024-09-08 14:39 ` [bug#73094] [PATCH v2 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
                     ` (3 preceding siblings ...)
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 05/10] gnu: Add rust-derive-builder-macro-0.20 Nicolas Graves via Guix-patches via
@ 2024-09-08 14:39   ` Nicolas Graves via Guix-patches via
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 07/10] gnu: Add rust-unicode-normalization-alignments-0.1 Nicolas Graves via Guix-patches via
                     ` (3 subsequent siblings)
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-08 14:39 UTC (permalink / raw)
  To: 73094; +Cc: herman, ngraves

* gnu/packages/crates-io.scm (rust-derive-builder-0.20): New variable.
(rust-derive-builder-0.13): Inherit form rust-derive-builder-0.20.

Change-Id: I8d237c591872fd01605cdf73d19bc085b4a7ea6f
---
 gnu/packages/crates-io.scm | 30 ++++++++++++++++++++++++++----
 1 file changed, 26 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 97f955be12..0191793ac0 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -20554,21 +20554,21 @@ (define-public rust-derive-arbitrary-0.4
                        ("rust-quote" ,rust-quote-1)
                        ("rust-syn" ,rust-syn-1))))))
 
-(define-public rust-derive-builder-0.13
+(define-public rust-derive-builder-0.20
   (package
     (name "rust-derive-builder")
-    (version "0.13.1")
+    (version "0.20.1")
     (source (origin
               (method url-fetch)
               (uri (crate-uri "derive_builder" version))
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "1irqx6bz74kx48ivdwqp2xl1ibr8dbdwgh6573r8g00d82gicncg"))))
+                "0yw7frfcgza5rm7f1ckrsy1qy0i6gim3blw12xm186d1wrzg6cyd"))))
     (build-system cargo-build-system)
     (arguments
      `(#:cargo-inputs
-       (("rust-derive-builder-macro" ,rust-derive-builder-macro-0.13))
+       (("rust-derive-builder-macro" ,rust-derive-builder-macro-0.20))
        #:cargo-development-inputs
        (("rust-pretty-assertions" ,rust-pretty-assertions-0.6)
         ("rust-rustversion" ,rust-rustversion-1)
@@ -20581,6 +20581,28 @@ (define-public rust-derive-builder-0.13
 for arbitrary structs.")
     (license (list license:expat license:asl2.0))))
 
+(define-public rust-derive-builder-0.13
+  (package
+    (inherit rust-derive-builder-0.20)
+    (name "rust-derive-builder")
+    (version "0.13.1")
+    (source (origin
+              (method url-fetch)
+              (uri (crate-uri "derive_builder" version))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1irqx6bz74kx48ivdwqp2xl1ibr8dbdwgh6573r8g00d82gicncg"))))
+    (arguments
+     `(#:cargo-inputs
+       (("rust-derive-builder-macro" ,rust-derive-builder-macro-0.13))
+       #:cargo-development-inputs
+       (("rust-pretty-assertions" ,rust-pretty-assertions-0.6)
+        ("rust-rustversion" ,rust-rustversion-1)
+        ("rust-serde" ,rust-serde-1)
+        ("rust-serde-json" ,rust-serde-json-1)
+        ("rust-trybuild" ,rust-trybuild-1))))))
+
 (define-public rust-derive-builder-0.12
   (package
     (inherit rust-derive-builder-0.13)
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v2 07/10] gnu: Add rust-unicode-normalization-alignments-0.1.
  2024-09-08 14:39 ` [bug#73094] [PATCH v2 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
                     ` (4 preceding siblings ...)
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 06/10] gnu: Add rust-derive-builder-0.20 Nicolas Graves via Guix-patches via
@ 2024-09-08 14:39   ` Nicolas Graves via Guix-patches via
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 08/10] gnu: Add rust-rayon-cond-0.3 Nicolas Graves via Guix-patches via
                     ` (2 subsequent siblings)
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-08 14:39 UTC (permalink / raw)
  To: 73094; +Cc: herman, ngraves

* gnu/packages/crates-io.scm (rust-unicode-normalization-alignments-0.1): New variable.

Change-Id: I338fd9a00affd1d83ace8356b6276fda476a68c8
---
 gnu/packages/crates-io.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 0191793ac0..8fc04f41af 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -86736,6 +86736,28 @@ (define-public rust-unicode-normalization-0.1
 described in Unicode Standard Annex #15.")
     (license (list license:expat license:asl2.0))))
 
+(define-public rust-unicode-normalization-alignments-0.1
+  (package
+    (name "rust-unicode-normalization-alignments")
+    (version "0.1.12")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "unicode-normalization-alignments" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1pk2f3arh3qvdsmrsiri0gr5y5vqpk2gv1yjin0njvh4zbj17xj3"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-smallvec" ,rust-smallvec-1))))
+    (home-page "https://github.com/n1t0/unicode-normalization")
+    (synopsis "Normalize Unicode strings ")
+    (description
+     "This crate provides functions for normalization of Unicode strings, including
+Canonical and Compatible Decomposition and Recomposition, as described in
+Unicode Standard Annex #15.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public rust-unicode-reverse-1
   (package
     (name "rust-unicode-reverse")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v2 08/10] gnu: Add rust-rayon-cond-0.3.
  2024-09-08 14:39 ` [bug#73094] [PATCH v2 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
                     ` (5 preceding siblings ...)
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 07/10] gnu: Add rust-unicode-normalization-alignments-0.1 Nicolas Graves via Guix-patches via
@ 2024-09-08 14:39   ` Nicolas Graves via Guix-patches via
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 09/10] gnu: Add rust-safetensors Nicolas Graves via Guix-patches via
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 10/10] gnu: Add python-safetensors Nicolas Graves via Guix-patches via
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-08 14:39 UTC (permalink / raw)
  To: 73094; +Cc: herman, ngraves

* gnu/packages/crates-io.scm (rust-rayon-cond-0.3): New variable.

Change-Id: I2683b5cb5c698380cd9485b0a6f090f827678c4d
---
 gnu/packages/crates-io.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 8fc04f41af..c4b17c7a54 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -61810,6 +61810,29 @@ (define-public rust-rawkey-0.1
      "This package provides support for raw key input in terminals.")
     (license license:expat)))
 
+(define-public rust-rayon-cond-0.3
+  (package
+    (name "rust-rayon-cond")
+    (version "0.3.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "rayon-cond" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1ybxppq84p3q60h9rng9j3dm79f6970hn4wljyf31lpgan5m77q5"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-either" ,rust-either-1)
+                       ("rust-itertools" ,rust-itertools-0.11)
+                       ("rust-rayon" ,rust-rayon-1))))
+    (home-page "https://github.com/cuviper/rayon-cond")
+    (synopsis "Experimental iterator wrapper")
+    (description
+     "This package provides a Rust experimental iterator wrapper that is
+conditionally parallel or serial.")
+    (license (list license:asl2.0 license:expat))))
+
 (define-public rust-rayon-core-1
   (package
     (name "rust-rayon-core")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v2 09/10] gnu: Add rust-safetensors.
  2024-09-08 14:39 ` [bug#73094] [PATCH v2 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
                     ` (6 preceding siblings ...)
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 08/10] gnu: Add rust-rayon-cond-0.3 Nicolas Graves via Guix-patches via
@ 2024-09-08 14:39   ` Nicolas Graves via Guix-patches via
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 10/10] gnu: Add python-safetensors Nicolas Graves via Guix-patches via
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-08 14:39 UTC (permalink / raw)
  To: 73094; +Cc: herman, ngraves

* gnu/packages/machine-learning.scm (rust-safetensors): New variable.

Change-Id: I2733dbae90b292ed6485666cf875d6fb899c5d12
---
 gnu/packages/machine-learning.scm | 32 ++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index d9a02b7093..a4aeb97be7 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -17,7 +17,7 @@
 ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
 ;;; Copyright © 2020, 2021, 2022, 2023, 2024 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
-;;; Copyright © 2022, 2023 Nicolas Graves <ngraves@ngraves.fr>
+;;; Copyright © 2022, 2023, 2024 Nicolas Graves <ngraves@ngraves.fr>
 ;;; Copyright © 2022 Kiran Shila <me@kiranshila.com>
 ;;; Copyright © 2023 zamfofex <zamfofex@twdb.moe>
 ;;; Copyright © 2023 Navid Afkhami <navid.afkhami@mdc-berlin.de>
@@ -52,6 +52,7 @@ (define-module (gnu packages machine-learning)
   #:use-module (guix utils)
   #:use-module (guix download)
   #:use-module (guix svn-download)
+  #:use-module (guix build-system cargo)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system copy)
   #:use-module (guix build-system gnu)
@@ -77,6 +78,7 @@ (define-module (gnu packages machine-learning)
   #:use-module (gnu packages cmake)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages cran)
+  #:use-module (gnu packages crates-io)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages dejagnu)
   #:use-module (gnu packages documentation)
@@ -1090,6 +1092,34 @@ (define-public python-sacrebleu
 and reproducible BLEU, chrF, and TER scores for natural language processing.")
     (license license:asl2.0)))
 
+(define-public rust-safetensors
+  (package
+    (name "rust-safetensors")
+    (version "0.4.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "safetensors" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1fbx56wikqcvqb4y0ym0cys68lj0v3cpanhsy5i13fkz5jr7dvcc"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs
+       (("rust-serde" ,rust-serde-1)
+        ("rust-serde-json" ,rust-serde-json-1))
+       #:cargo-development-inputs
+       (("rust-criterion" ,rust-criterion-0.5)
+        ("rust-memmap2" ,rust-memmap2-0.9)
+        ("rust-proptest" ,rust-proptest-1))))
+    (home-page "https://github.com/huggingface/safetensors")
+    (synopsis "Simple and safe way to store and distribute tensors")
+    (description
+     "This package provides a fast (zero-copy) and safe (dedicated) format for
+storing tensors safely, named safetensors.  They aim to be safer than their
+@code{PyTorch} counterparts.")
+    (license license:asl2.0)))
+
 (define-public python-sentencepiece
   (package
     (name "python-sentencepiece")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v2 10/10] gnu: Add python-safetensors.
  2024-09-08 14:39 ` [bug#73094] [PATCH v2 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
                     ` (7 preceding siblings ...)
  2024-09-08 14:39   ` [bug#73094] [PATCH v2 09/10] gnu: Add rust-safetensors Nicolas Graves via Guix-patches via
@ 2024-09-08 14:39   ` Nicolas Graves via Guix-patches via
  8 siblings, 0 replies; 33+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-09-08 14:39 UTC (permalink / raw)
  To: 73094; +Cc: herman, ngraves

* gnu/packages/machine-learning.scm (python-safetensors): New variable.

Change-Id: I90a1684d06756ce87ca0862d745a75be5919f0b2
---
 gnu/packages/machine-learning.scm | 96 +++++++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index a4aeb97be7..5006ba7ca0 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1120,6 +1120,102 @@ (define-public rust-safetensors
 @code{PyTorch} counterparts.")
     (license license:asl2.0)))
 
+(define-public python-safetensors
+  (package
+    (name "python-safetensors")
+    (version "0.4.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "safetensors" version))
+       (sha256
+        (base32 "1hhiwy67jarm70l0k26fs1cjhzkgzrh79q14bklj2yp0qi8gr19g"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)))
+       (snippet
+        #~(begin  ;; Only keeping bindings.
+            (for-each (lambda (file)
+                        (unless (member file '("." ".." "bindings" "PKG-INFO"))
+                          (delete-file-recursively file)))
+                      (scandir "."))
+            (for-each (lambda (file)
+                        (unless (member file '("." ".."))
+                          (rename-file (string-append "bindings/python/" file) file)))
+                      (scandir "bindings/python"))))))
+    (build-system cargo-build-system)
+    (arguments
+     (list
+      #:modules '((guix build cargo-build-system)
+                  (guix build utils)
+                  (ice-9 regex)
+                  (ice-9 textual-ports))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack-rust-crates 'inject-safetensors
+            (lambda _
+              (substitute* "Cargo.toml"
+                (("\\[dependencies\\]")
+                 (format #f "[dependencies]~%safetensors = ~s"
+                         #$(package-version rust-safetensors))))
+              (call-with-input-file "Cargo.toml"
+                (lambda (port)
+                  (let* ((content (get-string-all port))
+                         (top-match (string-match
+                                     "\\[dependencies.safetensors" content)))
+                    (call-with-output-file "Cargo.toml"
+                      (lambda (out)
+                        (format out "~a" (match:prefix top-match)))))))))
+          (add-before 'check 'install-rust-library
+            (lambda _
+              (copy-file "target/release/libsafetensors_rust.so"
+                         "py_src/safetensors/_safetensors_rust.so")))
+          (replace 'check
+            (lambda _
+              (invoke "python3"
+                      "-c" (format #f
+                                   "import sys; sys.path.append(\"~a/py_src\")"
+                                   (getcwd))
+                      "-m" "pytest"
+                      "-n" "auto"
+                      "--dist=loadfile"
+                      "-s" "-v" "./tests/"
+                      ;; Missing jax dependency
+                      "--ignore=./tests/test_flax_comparison.py")))
+          (add-after 'install 'install-python
+            (lambda _
+              (let* ((pversion #$(version-major+minor (package-version python)))
+                     (lib (string-append #$output "/lib/python" pversion
+                                         "/site-packages/"))
+                     (info (string-append lib "safetensors-"
+                                        #$(package-version this-package)
+                                        ".dist-info")))
+                (mkdir-p info)
+                (copy-file "PKG-INFO" (string-append info "/METADATA"))
+                (copy-recursively
+                 "py_src/safetensors"
+                 (string-append lib "safetensors"))))))
+      #:cargo-inputs
+      `(("rust-pyo3" ,rust-pyo3-0.21)
+        ("rust-memmap2" ,rust-memmap2-0.9)
+        ("rust-safetensors" ,rust-safetensors)
+        ("rust-serde-json" ,rust-serde-json-1))))
+    (inputs
+     (list rust-safetensors))
+    (native-inputs
+     (list python-h5py
+           python-minimal
+           python-numpy
+           python-pytest
+           python-pytest-xdist
+           python-pytorch
+           tensorflow))
+    (home-page "https://huggingface.co/docs/safetensors")
+    (synopsis "Simple and safe way to store and distribute tensors")
+    (description "This package provides a fast (zero-copy) and safe
+(dedicated) format for storing tensors safely.  This package builds upon
+@code{rust-safetensors} and provides Python bindings.")
+    (license license:asl2.0)))
+
 (define-public python-sentencepiece
   (package
     (name "python-sentencepiece")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v3 00/10] Add python-safetensors.
  2024-09-07  9:36 [bug#73094] [PATCH 00/10] Add python-safetensors Nicolas Graves via Guix-patches via
                   ` (2 preceding siblings ...)
  2024-09-08 14:39 ` [bug#73094] [PATCH v2 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
@ 2024-09-09 10:07 ` Herman Rimm via Guix-patches via
  2024-09-09 10:07   ` [bug#73094] [PATCH v3 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Herman Rimm via Guix-patches via
                     ` (9 more replies)
  3 siblings, 10 replies; 33+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-09-09 10:07 UTC (permalink / raw)
  To: 73094

Hello,

The python-safetensors package definition is changed to use 72 columns
at most.

Cheers,
Herman

Nicolas Graves (10):
  gnu: rust-darling-core-0.20: Update to 0.20.8.
  gnu: rust-darling-macro-0.20: Update to 0.20.8.
  gnu: rust-darling-0.20: Update to 0.20.8.
  gnu: Add rust-derive-builder-core-0.20.
  gnu: Add rust-derive-builder-macro-0.20.
  gnu: Add rust-derive-builder-0.20.
  gnu: Add rust-unicode-normalization-alignments-0.1.
  gnu: Add rust-rayon-cond-0.3.
  gnu: Add rust-safetensors.
  gnu: Add python-safetensors.

 gnu/packages/crates-io.scm        | 168 ++++++++++++++++++++++++------
 gnu/packages/machine-learning.scm | 132 ++++++++++++++++++++++-
 2 files changed, 268 insertions(+), 32 deletions(-)

-- 
2.45.2





^ permalink raw reply	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v3 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8.
  2024-09-09 10:07 ` [bug#73094] [PATCH v3 00/10] " Herman Rimm via Guix-patches via
@ 2024-09-09 10:07   ` Herman Rimm via Guix-patches via
  2024-09-09 10:07   ` [bug#73094] [PATCH v3 02/10] gnu: rust-darling-macro-0.20: " Herman Rimm via Guix-patches via
                     ` (8 subsequent siblings)
  9 siblings, 0 replies; 33+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-09-09 10:07 UTC (permalink / raw)
  To: 73094; +Cc: Nicolas Graves

From: Nicolas Graves <ngraves@ngraves.fr>

* gnu/packages/crates-io.scm (rust-darling-core-0.20): Update to 0.20.8.
[arguments]<#:skip-build?>: Set to #f.

Change-Id: I7cef57f0aea51665e5c15843764be2304601f2a5
---
 gnu/packages/crates-io.scm | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index a6eda94596..03fda06488 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -19169,7 +19169,7 @@ (define-public rust-darling-0.9
 (define-public rust-darling-core-0.20
   (package
     (name "rust-darling-core")
-    (version "0.20.3")
+    (version "0.20.8")
     (source
      (origin
        (method url-fetch)
@@ -19177,11 +19177,10 @@ (define-public rust-darling-core-0.20
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32
-         "08g6afi3z9jgcqx7g41s1mzr6q3dj2z56vz7v1bv6941h51k8zhp"))))
+         "03x7s149p06xfwcq0lgkk4yxh6jf7jckny18nzp1yyk87b1g2b4w"))))
     (build-system cargo-build-system)
     (arguments
-     `(#:skip-build? #t
-       #:cargo-inputs
+     `(#:cargo-inputs
        (("rust-fnv" ,rust-fnv-1)
         ("rust-ident-case" ,rust-ident-case-1)
         ("rust-proc-macro2" ,rust-proc-macro2-1)
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v3 02/10] gnu: rust-darling-macro-0.20: Update to 0.20.8.
  2024-09-09 10:07 ` [bug#73094] [PATCH v3 00/10] " Herman Rimm via Guix-patches via
  2024-09-09 10:07   ` [bug#73094] [PATCH v3 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Herman Rimm via Guix-patches via
@ 2024-09-09 10:07   ` Herman Rimm via Guix-patches via
  2024-09-09 10:07   ` [bug#73094] [PATCH v3 03/10] gnu: rust-darling-0.20: " Herman Rimm via Guix-patches via
                     ` (7 subsequent siblings)
  9 siblings, 0 replies; 33+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-09-09 10:07 UTC (permalink / raw)
  To: 73094; +Cc: Nicolas Graves

From: Nicolas Graves <ngraves@ngraves.fr>

* gnu/packages/crates-io.scm (rust-darling-macro-0.20): Update to
0.20.8.
  [origin](uri): Rename to darling_macro.
  [arguments]<#:skip-build?>: Set to #f.

Change-Id: Ic46f41b26e5fa918f222256b1c6047cfe0dba790
---
 gnu/packages/crates-io.scm | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 03fda06488..38aebaac08 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -19299,19 +19299,18 @@ (define-public rust-darling-core-0.9
 (define-public rust-darling-macro-0.20
   (package
     (name "rust-darling-macro")
-    (version "0.20.3")
+    (version "0.20.8")
     (source
      (origin
        (method url-fetch)
-       (uri (crate-uri "darling-macro" version))
+       (uri (crate-uri "darling_macro" version))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32
-         "1mg2k1f0v33s271lpn4m5mxcfjqnmg61bf77svb44cyngay9nsl3"))))
+         "0gwkz0cjfy3fgcc1zmm7azzhj5qpja34s0cklcria4l38sjyss56"))))
     (build-system cargo-build-system)
     (arguments
-     `(#:skip-build? #t
-       #:cargo-inputs
+     `(#:cargo-inputs
        (("rust-darling-core" ,rust-darling-core-0.20)
         ("rust-quote" ,rust-quote-1)
         ("rust-syn" ,rust-syn-2))))
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v3 03/10] gnu: rust-darling-0.20: Update to 0.20.8.
  2024-09-09 10:07 ` [bug#73094] [PATCH v3 00/10] " Herman Rimm via Guix-patches via
  2024-09-09 10:07   ` [bug#73094] [PATCH v3 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Herman Rimm via Guix-patches via
  2024-09-09 10:07   ` [bug#73094] [PATCH v3 02/10] gnu: rust-darling-macro-0.20: " Herman Rimm via Guix-patches via
@ 2024-09-09 10:07   ` Herman Rimm via Guix-patches via
  2024-09-09 10:07   ` [bug#73094] [PATCH v3 04/10] gnu: Add rust-derive-builder-core-0.20 Herman Rimm via Guix-patches via
                     ` (6 subsequent siblings)
  9 siblings, 0 replies; 33+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-09-09 10:07 UTC (permalink / raw)
  To: 73094; +Cc: Nicolas Graves

From: Nicolas Graves <ngraves@ngraves.fr>

* gnu/packages/crates-io.scm (rust-darling-0.20): Update to 0.20.8.
[arguments]<#:cargo-development-inputs>: Add rust-proc-macro2,
rust-quote, rust-rustversion, rust-syn, rust-trybuild.

Change-Id: Ib6569c26d6d74518a7069c1a5b89b60b67b8a152
---
 gnu/packages/crates-io.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 38aebaac08..38494dad3e 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -19032,7 +19032,7 @@ (define-public rust-daemonize-0.4
 (define-public rust-darling-0.20
   (package
     (name "rust-darling")
-    (version "0.20.3")
+    (version "0.20.8")
     (source
      (origin
        (method url-fetch)
@@ -19040,10 +19040,15 @@ (define-public rust-darling-0.20
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32
-         "0pjwwadwgnvvgn5qm3glpv7hjl7siaqqpw6cvh2mdar7lr6xj282"))))
+         "14a38qsi9104kvk1z11rqj0bnz1866dyhnvgvbgzz17d2g6nzqsl"))))
     (build-system cargo-build-system)
     (arguments
-     `(#:skip-build? #t
+     `(#:cargo-development-inputs
+       (("rust-proc-macro2" ,rust-proc-macro2-1)
+        ("rust-quote" ,rust-quote-1)
+        ("rust-rustversion" ,rust-rustversion-1)
+        ("rust-syn" ,rust-syn-2)
+        ("rust-trybuild" ,rust-trybuild-1))
        #:cargo-inputs
        (("rust-darling-core" ,rust-darling-core-0.20)
         ("rust-darling-macro" ,rust-darling-macro-0.20))))
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v3 04/10] gnu: Add rust-derive-builder-core-0.20.
  2024-09-09 10:07 ` [bug#73094] [PATCH v3 00/10] " Herman Rimm via Guix-patches via
                     ` (2 preceding siblings ...)
  2024-09-09 10:07   ` [bug#73094] [PATCH v3 03/10] gnu: rust-darling-0.20: " Herman Rimm via Guix-patches via
@ 2024-09-09 10:07   ` Herman Rimm via Guix-patches via
  2024-09-09 10:07   ` [bug#73094] [PATCH v3 05/10] gnu: Add rust-derive-builder-macro-0.20 Herman Rimm via Guix-patches via
                     ` (5 subsequent siblings)
  9 siblings, 0 replies; 33+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-09-09 10:07 UTC (permalink / raw)
  To: 73094; +Cc: Nicolas Graves

From: Nicolas Graves <ngraves@ngraves.fr>

* gnu/packages/crates-io.scm (rust-derive-builder-core-0.20): New
variable.
  (rust-derive-builder-core-0.13): Inherit from
  rust-derive-builder-core-0.20.

Change-Id: I3a6ee4eaf1ddc00aa8e131bdc59f11d8ad54208c
---
 gnu/packages/crates-io.scm | 34 +++++++++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 38494dad3e..8acf6c007d 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -20569,8 +20569,34 @@ (define-public rust-derive-builder-0.7
          ("rust-skeptic" ,rust-skeptic-0.13)
          ("rust-syn" ,rust-syn-0.15))))))
 
+(define-public rust-derive-builder-core-0.20
+  (package
+    (name "rust-derive-builder-core")
+    (version "0.20.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "derive_builder_core" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "0f5fg9cc9y53fx1fm4bh0s1yxwvc7v1zsircy8s054hkjq2glcbl"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-darling" ,rust-darling-0.20)
+                       ("rust-proc-macro2" ,rust-proc-macro2-1)
+                       ("rust-quote" ,rust-quote-1)
+                       ("rust-syn" ,rust-syn-2))
+       #:cargo-development-inputs
+       (("rust-pretty-assertions" ,rust-pretty-assertions-1))))
+    (home-page "https://github.com/colin-kiegel/rust-derive-builder")
+    (synopsis "Internal helper library for @code{rust-derive-builder}")
+    (description
+     "Internal helper library for @code{rust-derive-builder}.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public rust-derive-builder-core-0.13
   (package
+    (inherit rust-derive-builder-core-0.20)
     (name "rust-derive-builder-core")
     (version "0.13.1")
     (source (origin
@@ -20580,19 +20606,13 @@ (define-public rust-derive-builder-core-0.13
               (sha256
                (base32
                 "1381dgjq6jhirww088dff8b00v2d99illvnan0l0kvz7qdy33v54"))))
-    (build-system cargo-build-system)
     (arguments
      `(#:cargo-inputs (("rust-darling" ,rust-darling-0.14)
                        ("rust-proc-macro2" ,rust-proc-macro2-1)
                        ("rust-quote" ,rust-quote-1)
                        ("rust-syn" ,rust-syn-1))
        #:cargo-development-inputs
-       (("rust-pretty-assertions" ,rust-pretty-assertions-1))))
-    (home-page "https://github.com/colin-kiegel/rust-derive-builder")
-    (synopsis "Internal helper library for @code{rust-derive-builder}")
-    (description
-     "Internal helper library for @code{rust-derive-builder}.")
-    (license (list license:expat license:asl2.0))))
+       (("rust-pretty-assertions" ,rust-pretty-assertions-1))))))
 
 (define-public rust-derive-builder-core-0.12
   (package
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v3 05/10] gnu: Add rust-derive-builder-macro-0.20.
  2024-09-09 10:07 ` [bug#73094] [PATCH v3 00/10] " Herman Rimm via Guix-patches via
                     ` (3 preceding siblings ...)
  2024-09-09 10:07   ` [bug#73094] [PATCH v3 04/10] gnu: Add rust-derive-builder-core-0.20 Herman Rimm via Guix-patches via
@ 2024-09-09 10:07   ` Herman Rimm via Guix-patches via
  2024-09-09 10:07   ` [bug#73094] [PATCH v3 06/10] gnu: Add rust-derive-builder-0.20 Herman Rimm via Guix-patches via
                     ` (4 subsequent siblings)
  9 siblings, 0 replies; 33+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-09-09 10:07 UTC (permalink / raw)
  To: 73094; +Cc: Nicolas Graves

From: Nicolas Graves <ngraves@ngraves.fr>

* gnu/packages/crates-io.scm (rust-derive-builder-macro-0.20): New
variable.
  (rust-derive-builder-macro-0.13): Inherit from
  rust-derive-builder-macro-0.20.

Change-Id: I7d39f3638c233c61f3ee29a2d107cc0e154a0246
---
 gnu/packages/crates-io.scm | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 8acf6c007d..42b8886f3f 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -20722,8 +20722,31 @@ (define-public rust-derive-builder-core-0.5
          ("rust-quote" ,rust-quote-0.6)
          ("rust-syn" ,rust-syn-0.15))))))
 
+(define-public rust-derive-builder-macro-0.20
+  (package
+    (name "rust-derive-builder-macro")
+    (version "0.20.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "derive_builder_macro" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1p2ijj442j30cvd1x5231jw8b4klyf65sl3rnxvri6zpbc1ygfja"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-derive-builder-core" ,rust-derive-builder-core-0.20)
+                       ("rust-syn" ,rust-syn-1))))
+    (home-page "https://github.com/colin-kiegel/rust-derive-builder")
+    (synopsis "Automatically implement the builder pattern for arbitrary structs")
+    (description
+     "This crate provides a Rust macro to automatically implement the builder
+pattern for arbitrary structs.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public rust-derive-builder-macro-0.13
   (package
+    (inherit rust-derive-builder-macro-0.20)
     (name "rust-derive-builder-macro")
     (version "0.13.1")
     (source (origin
@@ -20733,16 +20756,9 @@ (define-public rust-derive-builder-macro-0.13
               (sha256
                (base32
                 "09q17rzgf8bsj8n1bhlf4f93nmqg8va6321ppcd07f1mzg1nh0w7"))))
-    (build-system cargo-build-system)
     (arguments
      `(#:cargo-inputs (("rust-derive-builder-core" ,rust-derive-builder-core-0.13)
-                       ("rust-syn" ,rust-syn-1))))
-    (home-page "https://github.com/colin-kiegel/rust-derive-builder")
-    (synopsis "Automatically implement the builder pattern for arbitrary structs")
-    (description
-     "This crate provides a Rust macro to automatically implement the builder
-pattern for arbitrary structs.")
-    (license (list license:expat license:asl2.0))))
+                       ("rust-syn" ,rust-syn-1))))))
 
 (define-public rust-derive-builder-macro-0.12
   (package
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v3 06/10] gnu: Add rust-derive-builder-0.20.
  2024-09-09 10:07 ` [bug#73094] [PATCH v3 00/10] " Herman Rimm via Guix-patches via
                     ` (4 preceding siblings ...)
  2024-09-09 10:07   ` [bug#73094] [PATCH v3 05/10] gnu: Add rust-derive-builder-macro-0.20 Herman Rimm via Guix-patches via
@ 2024-09-09 10:07   ` Herman Rimm via Guix-patches via
  2024-09-09 10:08   ` [bug#73094] [PATCH v3 07/10] gnu: Add rust-unicode-normalization-alignments-0.1 Herman Rimm via Guix-patches via
                     ` (3 subsequent siblings)
  9 siblings, 0 replies; 33+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-09-09 10:07 UTC (permalink / raw)
  To: 73094; +Cc: Nicolas Graves

From: Nicolas Graves <ngraves@ngraves.fr>

* gnu/packages/crates-io.scm (rust-derive-builder-0.20): New variable.
(rust-derive-builder-0.13): Inherit form rust-derive-builder-0.20.

Change-Id: I8d237c591872fd01605cdf73d19bc085b4a7ea6f
---
 gnu/packages/crates-io.scm | 30 ++++++++++++++++++++++++++----
 1 file changed, 26 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 42b8886f3f..9b276578b6 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -20433,21 +20433,21 @@ (define-public rust-derive-arbitrary-0.4
                        ("rust-quote" ,rust-quote-1)
                        ("rust-syn" ,rust-syn-1))))))
 
-(define-public rust-derive-builder-0.13
+(define-public rust-derive-builder-0.20
   (package
     (name "rust-derive-builder")
-    (version "0.13.1")
+    (version "0.20.1")
     (source (origin
               (method url-fetch)
               (uri (crate-uri "derive_builder" version))
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "1irqx6bz74kx48ivdwqp2xl1ibr8dbdwgh6573r8g00d82gicncg"))))
+                "0yw7frfcgza5rm7f1ckrsy1qy0i6gim3blw12xm186d1wrzg6cyd"))))
     (build-system cargo-build-system)
     (arguments
      `(#:cargo-inputs
-       (("rust-derive-builder-macro" ,rust-derive-builder-macro-0.13))
+       (("rust-derive-builder-macro" ,rust-derive-builder-macro-0.20))
        #:cargo-development-inputs
        (("rust-pretty-assertions" ,rust-pretty-assertions-0.6)
         ("rust-rustversion" ,rust-rustversion-1)
@@ -20460,6 +20460,28 @@ (define-public rust-derive-builder-0.13
 for arbitrary structs.")
     (license (list license:expat license:asl2.0))))
 
+(define-public rust-derive-builder-0.13
+  (package
+    (inherit rust-derive-builder-0.20)
+    (name "rust-derive-builder")
+    (version "0.13.1")
+    (source (origin
+              (method url-fetch)
+              (uri (crate-uri "derive_builder" version))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1irqx6bz74kx48ivdwqp2xl1ibr8dbdwgh6573r8g00d82gicncg"))))
+    (arguments
+     `(#:cargo-inputs
+       (("rust-derive-builder-macro" ,rust-derive-builder-macro-0.13))
+       #:cargo-development-inputs
+       (("rust-pretty-assertions" ,rust-pretty-assertions-0.6)
+        ("rust-rustversion" ,rust-rustversion-1)
+        ("rust-serde" ,rust-serde-1)
+        ("rust-serde-json" ,rust-serde-json-1)
+        ("rust-trybuild" ,rust-trybuild-1))))))
+
 (define-public rust-derive-builder-0.12
   (package
     (inherit rust-derive-builder-0.13)
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v3 07/10] gnu: Add rust-unicode-normalization-alignments-0.1.
  2024-09-09 10:07 ` [bug#73094] [PATCH v3 00/10] " Herman Rimm via Guix-patches via
                     ` (5 preceding siblings ...)
  2024-09-09 10:07   ` [bug#73094] [PATCH v3 06/10] gnu: Add rust-derive-builder-0.20 Herman Rimm via Guix-patches via
@ 2024-09-09 10:08   ` Herman Rimm via Guix-patches via
  2024-09-09 10:08   ` [bug#73094] [PATCH v3 08/10] gnu: Add rust-rayon-cond-0.3 Herman Rimm via Guix-patches via
                     ` (2 subsequent siblings)
  9 siblings, 0 replies; 33+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-09-09 10:08 UTC (permalink / raw)
  To: 73094; +Cc: Nicolas Graves

From: Nicolas Graves <ngraves@ngraves.fr>

* gnu/packages/crates-io.scm (rust-unicode-normalization-alignments-0.1): New variable.

Change-Id: I338fd9a00affd1d83ace8356b6276fda476a68c8
---
 gnu/packages/crates-io.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 9b276578b6..2eb9f546b4 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -86128,6 +86128,28 @@ (define-public rust-unicode-normalization-0.1
 described in Unicode Standard Annex #15.")
     (license (list license:expat license:asl2.0))))
 
+(define-public rust-unicode-normalization-alignments-0.1
+  (package
+    (name "rust-unicode-normalization-alignments")
+    (version "0.1.12")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "unicode-normalization-alignments" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1pk2f3arh3qvdsmrsiri0gr5y5vqpk2gv1yjin0njvh4zbj17xj3"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-smallvec" ,rust-smallvec-1))))
+    (home-page "https://github.com/n1t0/unicode-normalization")
+    (synopsis "Normalize Unicode strings ")
+    (description
+     "This crate provides functions for normalization of Unicode strings, including
+Canonical and Compatible Decomposition and Recomposition, as described in
+Unicode Standard Annex #15.")
+    (license (list license:expat license:asl2.0))))
+
 (define-public rust-unicode-reverse-1
   (package
     (name "rust-unicode-reverse")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v3 08/10] gnu: Add rust-rayon-cond-0.3.
  2024-09-09 10:07 ` [bug#73094] [PATCH v3 00/10] " Herman Rimm via Guix-patches via
                     ` (6 preceding siblings ...)
  2024-09-09 10:08   ` [bug#73094] [PATCH v3 07/10] gnu: Add rust-unicode-normalization-alignments-0.1 Herman Rimm via Guix-patches via
@ 2024-09-09 10:08   ` Herman Rimm via Guix-patches via
  2024-09-09 10:08   ` [bug#73094] [PATCH v3 09/10] gnu: Add rust-safetensors Herman Rimm via Guix-patches via
  2024-09-09 10:08   ` [bug#73094] [PATCH v3 10/10] gnu: Add python-safetensors Herman Rimm via Guix-patches via
  9 siblings, 0 replies; 33+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-09-09 10:08 UTC (permalink / raw)
  To: 73094; +Cc: Nicolas Graves

From: Nicolas Graves <ngraves@ngraves.fr>

* gnu/packages/crates-io.scm (rust-rayon-cond-0.3): New variable.

Change-Id: I2683b5cb5c698380cd9485b0a6f090f827678c4d
---
 gnu/packages/crates-io.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 2eb9f546b4..c525bf16b0 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -61344,6 +61344,29 @@ (define-public rust-rawkey-0.1
      "This package provides support for raw key input in terminals.")
     (license license:expat)))
 
+(define-public rust-rayon-cond-0.3
+  (package
+    (name "rust-rayon-cond")
+    (version "0.3.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "rayon-cond" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1ybxppq84p3q60h9rng9j3dm79f6970hn4wljyf31lpgan5m77q5"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-either" ,rust-either-1)
+                       ("rust-itertools" ,rust-itertools-0.11)
+                       ("rust-rayon" ,rust-rayon-1))))
+    (home-page "https://github.com/cuviper/rayon-cond")
+    (synopsis "Experimental iterator wrapper")
+    (description
+     "This package provides a Rust experimental iterator wrapper that is
+conditionally parallel or serial.")
+    (license (list license:asl2.0 license:expat))))
+
 (define-public rust-rayon-core-1
   (package
     (name "rust-rayon-core")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v3 09/10] gnu: Add rust-safetensors.
  2024-09-09 10:07 ` [bug#73094] [PATCH v3 00/10] " Herman Rimm via Guix-patches via
                     ` (7 preceding siblings ...)
  2024-09-09 10:08   ` [bug#73094] [PATCH v3 08/10] gnu: Add rust-rayon-cond-0.3 Herman Rimm via Guix-patches via
@ 2024-09-09 10:08   ` Herman Rimm via Guix-patches via
  2024-09-09 10:08   ` [bug#73094] [PATCH v3 10/10] gnu: Add python-safetensors Herman Rimm via Guix-patches via
  9 siblings, 0 replies; 33+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-09-09 10:08 UTC (permalink / raw)
  To: 73094; +Cc: Nicolas Graves

From: Nicolas Graves <ngraves@ngraves.fr>

* gnu/packages/machine-learning.scm (rust-safetensors): New variable.

Change-Id: I2733dbae90b292ed6485666cf875d6fb899c5d12
---
 gnu/packages/machine-learning.scm | 32 ++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 34dc5c8d26..410b71b061 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -17,7 +17,7 @@
 ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
 ;;; Copyright © 2020, 2021, 2022, 2023, 2024 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
-;;; Copyright © 2022, 2023 Nicolas Graves <ngraves@ngraves.fr>
+;;; Copyright © 2022, 2023, 2024 Nicolas Graves <ngraves@ngraves.fr>
 ;;; Copyright © 2022 Kiran Shila <me@kiranshila.com>
 ;;; Copyright © 2023 zamfofex <zamfofex@twdb.moe>
 ;;; Copyright © 2023 Navid Afkhami <navid.afkhami@mdc-berlin.de>
@@ -51,6 +51,7 @@ (define-module (gnu packages machine-learning)
   #:use-module (guix utils)
   #:use-module (guix download)
   #:use-module (guix svn-download)
+  #:use-module (guix build-system cargo)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system copy)
   #:use-module (guix build-system gnu)
@@ -76,6 +77,7 @@ (define-module (gnu packages machine-learning)
   #:use-module (gnu packages cmake)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages cran)
+  #:use-module (gnu packages crates-io)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages dejagnu)
   #:use-module (gnu packages documentation)
@@ -1055,6 +1057,34 @@ (define-public python-sacrebleu
 and reproducible BLEU, chrF, and TER scores for natural language processing.")
     (license license:asl2.0)))
 
+(define-public rust-safetensors
+  (package
+    (name "rust-safetensors")
+    (version "0.4.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "safetensors" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1fbx56wikqcvqb4y0ym0cys68lj0v3cpanhsy5i13fkz5jr7dvcc"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs
+       (("rust-serde" ,rust-serde-1)
+        ("rust-serde-json" ,rust-serde-json-1))
+       #:cargo-development-inputs
+       (("rust-criterion" ,rust-criterion-0.5)
+        ("rust-memmap2" ,rust-memmap2-0.9)
+        ("rust-proptest" ,rust-proptest-1))))
+    (home-page "https://github.com/huggingface/safetensors")
+    (synopsis "Simple and safe way to store and distribute tensors")
+    (description
+     "This package provides a fast (zero-copy) and safe (dedicated) format for
+storing tensors safely, named safetensors.  They aim to be safer than their
+@code{PyTorch} counterparts.")
+    (license license:asl2.0)))
+
 (define-public python-sentencepiece
   (package
     (name "python-sentencepiece")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [bug#73094] [PATCH v3 10/10] gnu: Add python-safetensors.
  2024-09-09 10:07 ` [bug#73094] [PATCH v3 00/10] " Herman Rimm via Guix-patches via
                     ` (8 preceding siblings ...)
  2024-09-09 10:08   ` [bug#73094] [PATCH v3 09/10] gnu: Add rust-safetensors Herman Rimm via Guix-patches via
@ 2024-09-09 10:08   ` Herman Rimm via Guix-patches via
  9 siblings, 0 replies; 33+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-09-09 10:08 UTC (permalink / raw)
  To: 73094; +Cc: Nicolas Graves

From: Nicolas Graves <ngraves@ngraves.fr>

* gnu/packages/machine-learning.scm (python-safetensors): New variable.

Change-Id: I90a1684d06756ce87ca0862d745a75be5919f0b2
---
 gnu/packages/machine-learning.scm | 100 ++++++++++++++++++++++++++++++
 1 file changed, 100 insertions(+)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 410b71b061..8b9dd2f7e4 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1085,6 +1085,106 @@ (define-public rust-safetensors
 @code{PyTorch} counterparts.")
     (license license:asl2.0)))
 
+(define-public python-safetensors
+  (package
+    (name "python-safetensors")
+    (version "0.4.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "safetensors" version))
+       (sha256
+        (base32 "1hhiwy67jarm70l0k26fs1cjhzkgzrh79q14bklj2yp0qi8gr19g"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)))
+       (snippet
+        #~(begin  ;; Only keeping bindings.
+            (for-each
+              (lambda (file)
+                (unless (member file '("." ".." "bindings" "PKG-INFO"))
+                  (delete-file-recursively file)))
+              (scandir "."))
+            (for-each
+              (lambda (file)
+                (unless (member file '("." ".."))
+                  (rename-file (string-append "bindings/python/" file)
+                               file)))
+              (scandir "bindings/python"))))))
+    (build-system cargo-build-system)
+    (arguments
+     (list
+      #:modules '((guix build cargo-build-system)
+                  (guix build utils)
+                  (ice-9 regex)
+                  (ice-9 textual-ports)
+                  (srfi srfi-26))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack-rust-crates 'inject-safetensors
+            (lambda _
+              (substitute* "Cargo.toml"
+                (("\\[dependencies\\]")
+                 (format #f "[dependencies]~%safetensors = ~s"
+                         #$(package-version rust-safetensors))))
+              (call-with-input-file "Cargo.toml"
+                (lambda (port)
+                  (let* ((content (get-string-all port))
+                         (top-match (string-match
+                                      "\\[dependencies.safetensors"
+                                      content)))
+                    (call-with-output-file "Cargo.toml"
+                      (cut display (match:prefix top-match) <>)))))))
+          (add-before 'check 'install-rust-library
+            (lambda _
+              (copy-file "target/release/libsafetensors_rust.so"
+                         "py_src/safetensors/_safetensors_rust.so")))
+          (replace 'check
+            (lambda _
+              (invoke "python3"
+                      "-c" (string-append "import sys; sys.path.append"
+                                          "(\"" (getcwd) "/py_src\")")
+                      "-m" "pytest"
+                      "-n" "auto"
+                      "--dist=loadfile"
+                      "-s" "-v" "./tests/"
+                      ;; Missing jax dependency
+                      "--ignore=./tests/test_flax_comparison.py")))
+          (add-after 'install 'install-python
+            (lambda _
+              (let* ((pversion #$(version-major+minor
+                                   (package-version python)))
+                     (lib (string-append #$output "/lib/python" pversion
+                                         "/site-packages/"))
+                     (info (string-append lib "safetensors-"
+                                        #$(package-version this-package)
+                                        ".dist-info")))
+                (mkdir-p info)
+                (copy-file "PKG-INFO" (string-append info "/METADATA"))
+                (copy-recursively
+                 "py_src/safetensors"
+                 (string-append lib "safetensors"))))))
+      #:cargo-inputs
+      `(("rust-pyo3" ,rust-pyo3-0.21)
+        ("rust-memmap2" ,rust-memmap2-0.9)
+        ("rust-safetensors" ,rust-safetensors)
+        ("rust-serde-json" ,rust-serde-json-1))))
+    (inputs
+     (list rust-safetensors))
+    (native-inputs
+     (list python-h5py
+           python-minimal
+           python-numpy
+           python-pytest
+           python-pytest-xdist
+           python-pytorch
+           tensorflow))
+    (home-page "https://huggingface.co/docs/safetensors")
+    (synopsis "Simple and safe way to store and distribute tensors")
+    (description "This package provides a fast (zero-copy) and safe
+(dedicated) format for storing tensors safely.  This package builds upon
+@code{rust-safetensors} and provides Python bindings.")
+    (license license:asl2.0)))
+
 (define-public python-sentencepiece
   (package
     (name "python-sentencepiece")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2024-09-09 10:11 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-07  9:36 [bug#73094] [PATCH 00/10] Add python-safetensors Nicolas Graves via Guix-patches via
2024-09-07 10:08 ` [bug#73094] [PATCH 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
2024-09-07 10:08   ` [bug#73094] [PATCH 02/10] gnu: rust-darling-macro-0.20: " Nicolas Graves via Guix-patches via
2024-09-07 10:08   ` [bug#73094] [PATCH 03/10] gnu: rust-darling-0.20: " Nicolas Graves via Guix-patches via
2024-09-07 10:08   ` [bug#73094] [PATCH 04/10] gnu: Add rust-derive-builder-core-0.20 Nicolas Graves via Guix-patches via
2024-09-07 10:08   ` [bug#73094] [PATCH 05/10] gnu: Add rust-derive-builder-macro-0.20 Nicolas Graves via Guix-patches via
2024-09-07 10:08   ` [bug#73094] [PATCH 06/10] gnu: Add rust-derive-builder-0.20 Nicolas Graves via Guix-patches via
2024-09-07 10:08   ` [bug#73094] [PATCH 07/10] gnu: Add rust-unicode-normalization-alignments-0.1 Nicolas Graves via Guix-patches via
2024-09-07 10:08   ` [bug#73094] [PATCH 08/10] gnu: Add rust-rayon-cond-0.3 Nicolas Graves via Guix-patches via
2024-09-07 10:08   ` [bug#73094] [PATCH 09/10] gnu: Add rust-safetensors Nicolas Graves via Guix-patches via
2024-09-07 10:08   ` [bug#73094] [PATCH 10/10] gnu: Add python-safetensors Nicolas Graves via Guix-patches via
2024-09-08 12:46 ` [bug#73094] [PATCH 00/10] " Herman Rimm via Guix-patches via
2024-09-08 14:39 ` [bug#73094] [PATCH v2 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Nicolas Graves via Guix-patches via
2024-09-08 14:39   ` [bug#73094] [PATCH v2 02/10] gnu: rust-darling-macro-0.20: " Nicolas Graves via Guix-patches via
2024-09-08 14:39   ` [bug#73094] [PATCH v2 03/10] gnu: rust-darling-0.20: " Nicolas Graves via Guix-patches via
2024-09-08 14:39   ` [bug#73094] [PATCH v2 04/10] gnu: Add rust-derive-builder-core-0.20 Nicolas Graves via Guix-patches via
2024-09-08 14:39   ` [bug#73094] [PATCH v2 05/10] gnu: Add rust-derive-builder-macro-0.20 Nicolas Graves via Guix-patches via
2024-09-08 14:39   ` [bug#73094] [PATCH v2 06/10] gnu: Add rust-derive-builder-0.20 Nicolas Graves via Guix-patches via
2024-09-08 14:39   ` [bug#73094] [PATCH v2 07/10] gnu: Add rust-unicode-normalization-alignments-0.1 Nicolas Graves via Guix-patches via
2024-09-08 14:39   ` [bug#73094] [PATCH v2 08/10] gnu: Add rust-rayon-cond-0.3 Nicolas Graves via Guix-patches via
2024-09-08 14:39   ` [bug#73094] [PATCH v2 09/10] gnu: Add rust-safetensors Nicolas Graves via Guix-patches via
2024-09-08 14:39   ` [bug#73094] [PATCH v2 10/10] gnu: Add python-safetensors Nicolas Graves via Guix-patches via
2024-09-09 10:07 ` [bug#73094] [PATCH v3 00/10] " Herman Rimm via Guix-patches via
2024-09-09 10:07   ` [bug#73094] [PATCH v3 01/10] gnu: rust-darling-core-0.20: Update to 0.20.8 Herman Rimm via Guix-patches via
2024-09-09 10:07   ` [bug#73094] [PATCH v3 02/10] gnu: rust-darling-macro-0.20: " Herman Rimm via Guix-patches via
2024-09-09 10:07   ` [bug#73094] [PATCH v3 03/10] gnu: rust-darling-0.20: " Herman Rimm via Guix-patches via
2024-09-09 10:07   ` [bug#73094] [PATCH v3 04/10] gnu: Add rust-derive-builder-core-0.20 Herman Rimm via Guix-patches via
2024-09-09 10:07   ` [bug#73094] [PATCH v3 05/10] gnu: Add rust-derive-builder-macro-0.20 Herman Rimm via Guix-patches via
2024-09-09 10:07   ` [bug#73094] [PATCH v3 06/10] gnu: Add rust-derive-builder-0.20 Herman Rimm via Guix-patches via
2024-09-09 10:08   ` [bug#73094] [PATCH v3 07/10] gnu: Add rust-unicode-normalization-alignments-0.1 Herman Rimm via Guix-patches via
2024-09-09 10:08   ` [bug#73094] [PATCH v3 08/10] gnu: Add rust-rayon-cond-0.3 Herman Rimm via Guix-patches via
2024-09-09 10:08   ` [bug#73094] [PATCH v3 09/10] gnu: Add rust-safetensors Herman Rimm via Guix-patches via
2024-09-09 10:08   ` [bug#73094] [PATCH v3 10/10] gnu: Add python-safetensors Herman Rimm via Guix-patches via

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).