This is an automated email from the git hooks/post-receive script.

guix_mirror_bot pushed a commit to branch python-team
in repository guix.

The following commit(s) were added to refs/heads/python-team by this push:
     new 77c8613648 gnu: onnxruntime: Fix build for python-numpy 2.4.6.
77c8613648 is described below

commit 77c861364841724b312af4b67956d6b2588b3e26
Author: Hugo Buddelmeijer <[email protected]>
AuthorDate: Mon Jul 13 14:02:26 2026 +0200

    gnu: onnxruntime: Fix build for python-numpy 2.4.6.
    
    * gnu/packages/machine-learning.scm (onnxruntime)[arguments]<#:phases>:
    Add 'fix-numpy phase.
    
    Signed-off-by: Andreas Enge <[email protected]>
---
 gnu/packages/machine-learning.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/machine-learning.scm 
b/gnu/packages/machine-learning.scm
index faf3b1e28f..fe41123757 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -2484,6 +2484,14 @@ with a single function call.")
                  (car (string-split #$(package-version
                                        (this-package-input "abseil-cpp"))
                                     #\.))))))
+          (add-after 'unpack 'fix-numpy
+            ;; Prevent TypeError: only 0-dimensional arrays can be converted
+            ;; to Python scalars.
+            ;; Fixed upstream in 71d2cd0173c863ee67b3a6803aea248c563d5427.
+            (lambda _
+              (substitute*
+                  "onnxruntime/python/tools/transformers/fusion_attention.py"
+                (("float\\(mul_val)") "mul_val.item()"))))
           (add-after 'install 'build-python
             (lambda _
               (invoke "python3" "../setup.py" "bdist_wheel")))

Reply via email to