~ruther/guix-local

4eaeff997907bc1b67884a6dc087756a50f175e2 — Danny Milosavljevic 1 year, 4 months ago 5eac239
gnu: Add whisper-cpp.

* gnu/packages/machine-learning.scm (whisper-cpp): New variable.

Change-Id: I1ab60be8a64b517d537fad651a7fabcd012025a1
1 files changed, 44 insertions(+), 0 deletions(-)

M gnu/packages/machine-learning.scm
M gnu/packages/machine-learning.scm => gnu/packages/machine-learning.scm +44 -0
@@ 648,6 648,50 @@ of foundation language models.  It requires models parameters to be downloaded
independently to be able to run a LLaMA model.")
      (license license:expat))))

(define-public whisper-cpp
  (package
    (name "whisper-cpp")
    (version "1.7.3")
    (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
                "0rrkgrx8akw91b77kl36i03i39a79r0p69glhhidm28qfw02icjx"))))
    (build-system cmake-build-system)
    (arguments
      (list
        #:tests? #false ; uhh. They have it commented out in CMakeLists.txt
        #:configure-flags
        #~(list "-DBUILD_SHARED_LIBS=ON"
                "-DGGML_BLAS=ON"
                "-DGGML_BLAS_VENDOR=OpenBLAS"
                (string-append "-DBLAS_INCLUDE_DIRS="
                               #$(this-package-input "openblas")
                               "/include")
                (string-append "-DBLAS_LIBRARIES="
                               #$(this-package-input "openblas")
                               "/lib/libopenblas.so")

                "-DGGML_NATIVE=OFF" ;no '-march=native'
                "-DGGML_FMA=OFF"    ;and no '-mfma', etc.
                "-DGGML_AVX2=OFF"
                "-DGGML_AVX512=OFF"
                "-DGGML_AVX512_VBMI=OFF"
                "-DGGML_AVX512_VNNI=OFF")))
    (native-inputs
     (list pkg-config))
    (inputs
     (list openblas))
    (synopsis "Speech recognition")
    (description "This package provides speech recognition.")
    (properties '((tunable? . #true))) ;use AVX512, FMA, etc. when available
    (home-page "https://github.com/ggerganov/whisper.cpp")
    (license license:expat)))

(define-public mcl
  (package
    (name "mcl")