[PATCH] gnu: Add whisper-cpp.

  • Open
  • quality assurance status badge
Details
One participant
  • Andy Tai
Owner
unassigned
Submitted by
Andy Tai
Severity
normal
A
A
Andy Tai wrote on 10 Jul 06:53 +0200
(address . guix-patches@gnu.org)(name . Andy Tai)(address . atai@atai.org)
0c08fdb11c2641ece7d267340877c58f144df110.1720587166.git.atai@atai.org
* gnu/packages/machine-learning.scm (whisper-cpp): New variable.

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

Toggle diff (38 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 8ca9a6376e..61c25b49da 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -5982,6 +5982,29 @@ (define-public oneapi-dnnl-for-r-torch
(sha256
(base32 "1zyw5rd8x346bb7gac9a7x3saviw3zvp6aqz2z1l9sv163vmjfz6"))))))
+(define-public whisper-cpp
+ (package
+ (name "whisper-cpp")
+ (version "1.6.2")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/ggerganov/whisper.cpp")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "01q4j602wkvsf9vw0nsazzgvjppf4fhpy90vqnm9affynyxhi0c4"))))
+ (build-system cmake-build-system)
+ (properties '((tunable? . #true))) ;use AVX512, FMA, etc. when available
+ (home-page "https://github.com/ggerganov/whisper.cpp")
+ (synopsis "Port of OpenAI's Whisper model in C/C++ ")
+ (description "This package is a high-performance inference of OpenAI's
+Whisper automatic speech recognition (ASR) model, implemented in plain C/C++
+without dependencies")
+ (license license:expat)))
+
+
(define-public python-gguf
(package
(name "python-gguf")

base-commit: e13f7d48e5b989f5dbd27c19ac81989ec6b3ec6e
--
2.34.1
A
A
Andy Tai wrote on 10 Jul 07:55 +0200
[PATCH v2] gnu: Add whisper-cpp.
(address . 72027@debbugs.gnu.org)(name . Andy Tai)(address . atai@atai.org)
52d89f216951358977afca847ac5dc4fda8aab86.1720590865.git.atai@atai.org
* gnu/packages/machine-learning.scm (whisper-cpp): New variable.

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

Toggle diff (62 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 8ca9a6376e..2af3c188c2 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -28,6 +28,7 @@
;;; Copyright © 2024 Timothee Mathieu <timothee.mathieu@inria.fr>
;;; Copyright © 2024 Spencer King <spencer.king@geneoscopy.com>
;;; Copyright © 2024 David Elsing <david.elsing@posteo.net>
+;;; Copyright © 2024 Andy Tai <atai@atai.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -117,6 +118,7 @@ (define-module (gnu packages machine-learning)
#:use-module (gnu packages rdf)
#:use-module (gnu packages regex)
#:use-module (gnu packages rpc)
+ #:use-module (gnu packages sdl)
#:use-module (gnu packages serialization)
#:use-module (gnu packages sphinx)
#:use-module (gnu packages statistics)
@@ -5982,6 +5984,37 @@ (define-public oneapi-dnnl-for-r-torch
(sha256
(base32 "1zyw5rd8x346bb7gac9a7x3saviw3zvp6aqz2z1l9sv163vmjfz6"))))))
+(define-public whisper-cpp
+ (package
+ (name "whisper-cpp")
+ (version "1.6.2")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/ggerganov/whisper.cpp")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "01q4j602wkvsf9vw0nsazzgvjppf4fhpy90vqnm9affynyxhi0c4"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list
+ #:configure-flags #~'("-DWHISPER_STANDALONE=TRUE")))
+ ;; "-DWHISPER_FFMPEG=TRUE" ; TO DO
+
+ ;; (inputs (list ffmpeg openblas sdl2)) ;TO DO:
+ (native-inputs (list pkg-config))
+ (properties '((tunable? . #t))) ;use AVX512, FMA, etc. when available
+ (home-page "https://github.com/ggerganov/whisper.cpp")
+ (synopsis "Port of OpenAI's Whisper model in C/C++")
+ (description
+ "This package is a high-performance inference of OpenAI's
+Whisper automatic speech recognition (ASR) model, implemented in plain C/C++
+without dependencies")
+ (license license:expat)))
+
+
(define-public python-gguf
(package
(name "python-gguf")

base-commit: 71694363f6cc79e44955acbd9f7ca108e658caca
--
2.34.1
A
A
Andy Tai wrote on 10 Jul 08:16 +0200
[PATCH v3] gnu: Add whisper-cpp.
(address . 72027@debbugs.gnu.org)(name . Andy Tai)(address . atai@atai.org)
c0d6a18be36db2d72d24c9d80f1c2c7aa7a4ef18.1720592144.git.atai@atai.org
* gnu/packages/machine-learning.scm (whisper-cpp): New variable.

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

Toggle diff (63 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 8ca9a6376e..0650c9620a 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -28,6 +28,7 @@
;;; Copyright © 2024 Timothee Mathieu <timothee.mathieu@inria.fr>
;;; Copyright © 2024 Spencer King <spencer.king@geneoscopy.com>
;;; Copyright © 2024 David Elsing <david.elsing@posteo.net>
+;;; Copyright © 2024 Andy Tai <atai@atai.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -117,6 +118,7 @@ (define-module (gnu packages machine-learning)
#:use-module (gnu packages rdf)
#:use-module (gnu packages regex)
#:use-module (gnu packages rpc)
+ #:use-module (gnu packages sdl)
#:use-module (gnu packages serialization)
#:use-module (gnu packages sphinx)
#:use-module (gnu packages statistics)
@@ -5982,6 +5984,38 @@ (define-public oneapi-dnnl-for-r-torch
(sha256
(base32 "1zyw5rd8x346bb7gac9a7x3saviw3zvp6aqz2z1l9sv163vmjfz6"))))))
+(define-public whisper-cpp
+ (package
+ (name "whisper-cpp")
+ (version "1.6.2")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/ggerganov/whisper.cpp")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "01q4j602wkvsf9vw0nsazzgvjppf4fhpy90vqnm9affynyxhi0c4"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list
+ #:configure-flags #~'("-DWHISPER_STANDALONE=TRUE"
+ "-DWHISPER_SDL2=TRUE")))
+ ;; "-DWHISPER_FFMPEG=TRUE" ; TO DO
+
+ (inputs (list sdl2)) ; ffmpeg openblas ;TO DO:
+ (native-inputs (list pkg-config))
+ (properties '((tunable? . #t))) ;use AVX512, FMA, etc. when available
+ (home-page "https://github.com/ggerganov/whisper.cpp")
+ (synopsis "Port of OpenAI's Whisper model in C/C++")
+ (description
+ "This package is a high-performance inference of OpenAI's
+Whisper automatic speech recognition (ASR) model, implemented in plain C/C++
+without dependencies")
+ (license license:expat)))
+
+
(define-public python-gguf
(package
(name "python-gguf")

base-commit: 71694363f6cc79e44955acbd9f7ca108e658caca
--
2.34.1
A
A
Andy Tai wrote on 11 Jul 08:46 +0200
[PATCH v4] gnu: Add whisper-cpp.
(address . 72027@debbugs.gnu.org)(name . Andy Tai)(address . atai@atai.org)
bbe2b3d8e44ce211e0f559f405be2c3127b6c673.1720680336.git.atai@atai.org
* gnu/packages/machine-learning.scm (whisper-cpp): New variable.

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

Toggle diff (71 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 303e123a15..b6ceca6cb0 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -28,6 +28,7 @@
;;; Copyright © 2024 Timothee Mathieu <timothee.mathieu@inria.fr>
;;; Copyright © 2024 Spencer King <spencer.king@geneoscopy.com>
;;; Copyright © 2024 David Elsing <david.elsing@posteo.net>
+;;; Copyright © 2024 Andy Tai <atai@atai.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -117,6 +118,7 @@ (define-module (gnu packages machine-learning)
#:use-module (gnu packages rdf)
#:use-module (gnu packages regex)
#:use-module (gnu packages rpc)
+ #:use-module (gnu packages sdl)
#:use-module (gnu packages serialization)
#:use-module (gnu packages sphinx)
#:use-module (gnu packages statistics)
@@ -5990,6 +5992,46 @@ (define-public oneapi-dnnl-for-r-torch
(sha256
(base32 "1zyw5rd8x346bb7gac9a7x3saviw3zvp6aqz2z1l9sv163vmjfz6"))))))
+(define-public whisper-cpp
+ (package
+ (name "whisper-cpp")
+ (version "1.6.2")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/ggerganov/whisper.cpp")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "01q4j602wkvsf9vw0nsazzgvjppf4fhpy90vqnm9affynyxhi0c4"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list
+ #:configure-flags #~'("-DWHISPER_STANDALONE=TRUE" "-DWHISPER_SDL2=TRUE")
+ ;; "-DWHISPER_FFMPEG=TRUE" ; TO DO
+ #:phases #~(modify-phases %standard-phases
+ #$@(if (not (target-64bit?))
+ #~(add-after 'unpack 'skip-failing-tests
+ (lambda _
+ ;; large model does not fit in RAM in 32-bit system,
+ ;; disable large model test
+ `((substitute* "tests/CMakeLists.txt"
+ (("LABELS \"large\"")
+ "DISABLED true")))))
+ #~()))))
+ (inputs (list sdl2)) ;ffmpeg openblas ;TO DO:
+ (native-inputs (list pkg-config))
+ (properties '((tunable? . #t))) ;use AVX512, FMA, etc. when available
+ (home-page "https://github.com/ggerganov/whisper.cpp")
+ (synopsis "Port of OpenAI's Whisper model in C/C++")
+ (description
+ "This package is a high-performance inference of OpenAI's
+Whisper automatic speech recognition (ASR) model, implemented in plain C/C++
+without dependencies")
+ (license license:expat)))
+
+
(define-public python-gguf
(package
(name "python-gguf")

base-commit: 8cbc5e5bf0ca35f12cf5bbf123efbc3b6a57ad44
--
2.34.1
A
A
Andy Tai wrote on 12 Jul 07:44 +0200
[PATCH v5] gnu: Add whisper-cpp.
(address . 72027@debbugs.gnu.org)(name . Andy Tai)(address . atai@atai.org)
e49d489116dca373d64f40de19a506549d7009a7.1720763019.git.atai@atai.org
* gnu/packages/machine-learning.scm (whisper-cpp): New variable.

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

Toggle diff (72 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 3680cab044..0471db8d46 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -28,6 +28,7 @@
;;; Copyright © 2024 Timothee Mathieu <timothee.mathieu@inria.fr>
;;; Copyright © 2024 Spencer King <spencer.king@geneoscopy.com>
;;; Copyright © 2024 David Elsing <david.elsing@posteo.net>
+;;; Copyright © 2024 Andy Tai <atai@atai.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -117,6 +118,7 @@ (define-module (gnu packages machine-learning)
#:use-module (gnu packages rdf)
#:use-module (gnu packages regex)
#:use-module (gnu packages rpc)
+ #:use-module (gnu packages sdl)
#:use-module (gnu packages serialization)
#:use-module (gnu packages sphinx)
#:use-module (gnu packages statistics)
@@ -5990,6 +5992,47 @@ (define-public oneapi-dnnl-for-r-torch
(sha256
(base32 "1zyw5rd8x346bb7gac9a7x3saviw3zvp6aqz2z1l9sv163vmjfz6"))))))
+(define-public whisper-cpp
+ (package
+ (name "whisper-cpp")
+ (version "1.6.2")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/ggerganov/whisper.cpp")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "01q4j602wkvsf9vw0nsazzgvjppf4fhpy90vqnm9affynyxhi0c4"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list
+ #:configure-flags #~'("-DWHISPER_STANDALONE=TRUE" "-DWHISPER_SDL2=TRUE")
+ ;; "-DWHISPER_FFMPEG=TRUE" ; TO DO
+ #:phases #~(modify-phases %standard-phases
+ #$@(if (not (target-64bit?))
+ '((add-after 'unpack 'skip-failing-tests
+ (lambda _
+ ;; 32-bit system
+ ;; large model does not fit in RAM in 32-bit system,
+ ;; disable large model test
+ (substitute* "tests/CMakeLists.txt"
+ (("LABELS \"large\"")
+ "DISABLED true")))))
+ '()))))
+ (inputs (list sdl2)) ;ffmpeg openblas ;TO DO:
+ (native-inputs (list pkg-config))
+ (properties '((tunable? . #t))) ;use AVX512, FMA, etc. when available
+ (home-page "https://github.com/ggerganov/whisper.cpp")
+ (synopsis "Port of OpenAI's Whisper model in C/C++")
+ (description
+ "This package is a high-performance inference of OpenAI's
+Whisper automatic speech recognition (ASR) model, implemented in plain C/C++
+without dependencies")
+ (license license:expat)))
+
+
(define-public python-gguf
(package
(name "python-gguf")

base-commit: 2d6a3799fcda5c017f653c6e96b91964b07a7ee0
--
2.34.1
?
Your comment

Commenting via the web interface is currently disabled.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 72027
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