whisper: update, and stream & server

This commit is contained in:
Pavel Korytov 2023-12-20 19:52:04 +03:00
parent 5adb1cbf84
commit 151e7edfd5

View file

@ -11,16 +11,16 @@
(define-public whisper-cpp (define-public whisper-cpp
(package (package
(name "whisper-cpp") (name "whisper-cpp")
(version "1.4.0") (version "1.5.2")
(source (origin (source (origin
(method git-fetch) (method git-fetch)
(uri (git-reference (uri (git-reference
(url "https://github.com/ggerganov/whisper.cpp/") (url "https://github.com/ggerganov/whisper.cpp/")
(commit "85ed71aaec8e0612a84c0b67804bde75aa75a273"))) (commit "9286d3f584240ba58bd44a1bd1e85141579c78d4")))
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32
"1gfjx5s1mz3ja5x1v3hx1p76v9xz5kd7c8n0p6hihkgmx1gl2p3y")))) "0322ylm2804amis8kizasvfvfci7cmg3nzqanrq9lfa3gpkbbph5"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
'(#:tests? #f ;; No tests '(#:tests? #f ;; No tests
@ -28,12 +28,16 @@
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(delete 'configure) ;; No configure script (delete 'configure) ;; No configure script
(add-after 'build 'make-stream
(lambda _ (invoke "make" "stream")))
(replace 'install ;; Makefile doesn't provide "install" (replace 'install ;; Makefile doesn't provide "install"
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let ((bin (string-append (assoc-ref outputs "out") "/bin"))) (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
(rename-file "main" "whisper-cpp") (rename-file "main" "whisper-cpp")
(rename-file "bench" "whisper-cpp-bench") (rename-file "bench" "whisper-cpp-bench")
(rename-file "quantize" "whisper-cpp-quantize") (rename-file "quantize" "whisper-cpp-quantize")
(rename-file "server" "whisper-cpp-server")
(rename-file "stream" "whisper-cpp-stream")
(substitute* "models/download-ggml-model.sh" (substitute* "models/download-ggml-model.sh"
(("cd \"\\$models_path\"") "") (("cd \"\\$models_path\"") "")
(("models_path=\"\\$\\(get_script_path\\)\"") "") (("models_path=\"\\$\\(get_script_path\\)\"") "")
@ -43,7 +47,9 @@
(install-file "models/download-ggml-model.sh" bin) (install-file "models/download-ggml-model.sh" bin)
(install-file "whisper-cpp" bin) (install-file "whisper-cpp" bin)
(install-file "whisper-cpp-bench" bin) (install-file "whisper-cpp-bench" bin)
(install-file "whisper-cpp-quantize" bin))))))) (install-file "whisper-cpp-quantize" bin)
(install-file "whisper-cpp-server" bin)
(install-file "whisper-cpp-stream" bin)))))))
(synopsis "Port of OpenAI's Whisper model in C/C++ ") (synopsis "Port of OpenAI's Whisper model in C/C++ ")
(native-inputs (native-inputs
`(("coreutils-minimal" ,coreutils-minimal) `(("coreutils-minimal" ,coreutils-minimal)