[PATCH] gnu: Add python-gguf.

  • Done
  • quality assurance status badge
Details
3 participants
  • Andreas Enge
  • David Pflug
  • Ricardo Wurmus
Owner
unassigned
Submitted by
David Pflug
Severity
normal

Debbugs page

David Pflug wrote 1 years ago
(address . guix-patches@gnu.org)(name . David Pflug)(address . david@pflug.io)
20240126121400.9946-1-david@pflug.io
* gnu/packages/machine-learning.scm (python-gguf): New variable.

Needed for llama-cpp update (In #68455).

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

Toggle diff (42 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 3a12eb8c2f..0e88f7265b 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -22,6 +22,7 @@
;;; Copyright © 2023 Navid Afkhami <navid.afkhami@mdc-berlin.de>
;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2023 Troy Figiel <troy@troyfigiel.com>
+;;; Copyright © 2024 David Pflug <david@pflug.io>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -5277,3 +5278,25 @@ (define-public oneapi-dnnl
"OneAPI Deep Neural Network Library (oneDNN) is a cross-platform
performance library of basic building blocks for deep learning applications.")
(license license:asl2.0)))
+
+(define-public python-gguf
+ (package
+ (name "python-gguf")
+ (version "0.6.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "gguf" version))
+ (sha256
+ (base32 "0rbyc2h3kpqnrvbyjvv8a69l577jv55a31l12jnw21m1lamjxqmj"))))
+ (build-system pyproject-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (delete 'check))))
+ (inputs (list poetry python-pytest))
+ (propagated-inputs (list python-numpy))
+ (home-page "https://ggml.ai")
+ (synopsis "Read and write ML models in GGUF for GGML")
+ (description "Read and write ML models in GGUF for GGML")
+ (license license:expat)))

base-commit: cdf1d7dded027019f0ebbd5d6f0147b13dfdd28d
--
2.41.0
Ricardo Wurmus wrote 1 years ago
(address . 68735@debbugs.gnu.org)(address . david@pflug.io)
87cytof9pp.fsf@elephly.net
Hi David,

thanks for the patch.

Why do you delete the check phase? When tests are to be disabled please
use “#:tests? #false”. If no tests are included in the Pypi tarball,
please fetch the code from the upstream repository instead.

Please use a plain list for the arguments field.

Please also use complete sentences in the description field.

--
Ricardo
David Pflug wrote 1 years ago
CYORQEEPBSSY.QV0VURMF2HL3@peacefulphillip
Hi Ricardo,

Thanks for the feedback. I'd been trying to skip tests because upstream only provides a stub: https://github.com/ggerganov/llama.cpp/blob/master/gguf-py/tests/test_gguf.py

I'll prep a v2 with the requested changes.

Warm Regards,

David
-----BEGIN PGP SIGNATURE-----

iQJDBAABCgAtFiEE8reZlmbYMJP41CEpJs3TIYmqKIUFAmWz2fsPHGRhdmlkQHBm
bHVnLmlvAAoJECbN0yGJqiiFAhIQAMQIeFudlIBAQRZEYOxWx15RqPdAin/3Xx9t
Kj0M2Eb+kYWtiIVp+BwbSGpdq4XzH67K9JknIPNgneH14hDb1Zu0XmqvKhjSJLU1
nlO/ZDoHpV1omi2cbcfpp8eZi3LroGE5OGH9Cy/RtbaG1+/2qIZNoRxSSUUI79ax
kTEIDdIkaVTx9IXvA6JsrSmKnY5g2dBBJdzMsQL1VXTjD5+B/G3XCnGrJPhUbm2t
w8zu+l+RcLQ3zU9asv0wYoc/q5Cnkiy/HC3ZP9YQFkDNwddenXHm3nUW+QY+6iBn
Tp9fFqFhk0VRnvYETorOYJhG4ZYJ9EIQJy/qsX8sJUJ6TUvE6JRH6TkNPNZsbqrZ
VsP3uc8YmzuYHkMcyTFWw5qsdPJ5OyVBQQ1YL7AebMFZPV2vY4J15gIqomQuh+D4
0keKoQLn1aruN7Ik8f1UkeVboYoqfsfMJITPe4RtEbH5Ailj8pbKNuRysIWXubng
q2KhzRseFszWw09s7aHqrbJw6mkGrQiO/BMO08Qoe+nm36NgMAPDFmZ4374hSVr9
fx5caJCwgx3TnQUv8M5SYptQFF9gktJ8+EnOf8CVmobii7EEnM6PHIKzqQN/+AgP
cQXY38kf6U+5YzRrbnFy5FmvIwT8oDNDm+t8W3uRjRMoSZoNLppLQOablKfoE3bc
k6ZH6iDe
=vQK8
-----END PGP SIGNATURE-----


David Pflug wrote 1 years ago
[PATCH v2] gnu: Add python-gguf.
(address . 68735@debbugs.gnu.org)(name . David Pflug)(address . david@pflug.io)
20240126162724.29652-1-david@pflug.io
* gnu/packages/machine-learning.scm (python-gguf): New variable.

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

Toggle diff (42 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 3a12eb8c2f..0e88f7265b 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -22,6 +22,7 @@
;;; Copyright © 2023 Navid Afkhami <navid.afkhami@mdc-berlin.de>
;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2023 Troy Figiel <troy@troyfigiel.com>
+;;; Copyright © 2024 David Pflug <david@pflug.io>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -5277,3 +5278,25 @@ (define-public oneapi-dnnl
"OneAPI Deep Neural Network Library (oneDNN) is a cross-platform
performance library of basic building blocks for deep learning applications.")
(license license:asl2.0)))
+
+(define-public python-gguf
+ (package
+ (name "python-gguf")
+ (version "0.6.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "gguf" version))
+ (sha256
+ (base32 "0rbyc2h3kpqnrvbyjvv8a69l577jv55a31l12jnw21m1lamjxqmj"))))
+ (build-system pyproject-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (delete 'check))))
+ (inputs (list poetry python-pytest))
+ (propagated-inputs (list python-numpy))
+ (home-page "https://ggml.ai")
+ (synopsis "Read and write ML models in GGUF for GGML")
+ (description "Read and write ML models in GGUF for GGML")
+ (license license:expat)))

base-commit: cdf1d7dded027019f0ebbd5d6f0147b13dfdd28d
--
2.41.0
David Pflug wrote 1 years ago
[PATCH v3] gnu: Add python-gguf.
(address . 68735@debbugs.gnu.org)(name . David Pflug)(address . david@pflug.io)
20240127035039.6294-1-david@pflug.io
* gnu/packages/machine-learning.scm (python-gguf): New variable.

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

Toggle diff (40 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 3a12eb8c2f..8beedb24fa 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -22,6 +22,7 @@
;;; Copyright © 2023 Navid Afkhami <navid.afkhami@mdc-berlin.de>
;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2023 Troy Figiel <troy@troyfigiel.com>
+;;; Copyright © 2024 David Pflug <david@pflug.io>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -5277,3 +5278,23 @@ (define-public oneapi-dnnl
"OneAPI Deep Neural Network Library (oneDNN) is a cross-platform
performance library of basic building blocks for deep learning applications.")
(license license:asl2.0)))
+
+(define-public python-gguf
+ (package
+ (name "python-gguf")
+ (version "0.6.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "gguf" version))
+ (sha256
+ (base32 "0rbyc2h3kpqnrvbyjvv8a69l577jv55a31l12jnw21m1lamjxqmj"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list #:tests? #false))
+ (inputs (list poetry python-pytest))
+ (propagated-inputs (list python-numpy))
+ (home-page "https://ggml.ai")
+ (synopsis "Read and write ML models in GGUF for GGML")
+ (description "A Python library for reading and writing GGUF & GGML format ML models.")
+ (license license:expat)))

base-commit: cdf1d7dded027019f0ebbd5d6f0147b13dfdd28d
--
2.41.0
Andreas Enge wrote 1 years ago
Close
(address . 68735-done@debbugs.gnu.org)
ZciE9PTPmxIVp33B@jurong
Pushed as commit b6439fc5f800b5d22d48192bc347be794f050329 after adding the
first line of the commit message and a comment to explain why tests are
disabled, and turning the synopsis into a complete sentence.

QA suggests to put python-pytest into native instead of regular inputs;
but "guix gc --references" shows that the package retains references
to python-pytest and to poetry, so I kept them where they are.

Ricardo, please feel free to correct me.

Thanks for the patch, David!

Andreas
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 68735@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 68735
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help