Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whisper-cpp: 1.6.0 #170645

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 15 additions & 7 deletions Formula/w/whisper-cpp.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class WhisperCpp < Formula
desc "Port of OpenAI's Whisper model in C/C++"
homepage "https://github.com/ggerganov/whisper.cpp"
url "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.5.4.tar.gz"
sha256 "06eed84de310fdf5408527e41e863ac3b80b8603576ba0521177464b1b341a3a"
url "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.6.0.tar.gz"
sha256 "2729a83662edf909dad66115a3b616c27011cbe4c05335656034954c91ba0c92"
license "MIT"
head "https://github.com/ggerganov/whisper.cpp.git", branch: "master"

Expand All @@ -22,10 +22,16 @@
end

def install
system "make"
if OS.mac?
system "make", "WHISPER_COREML=1"
else
system "make"
end

bin.install "main" => "whisper-cpp"
bin.install "server" => "whisper-cpp-server"

pkgshare.install ["samples/jfk.wav", "models/for-tests-ggml-tiny.bin", "ggml-metal.metal"]
pkgshare.install ["samples/jfk.wav", "models/for-tests-ggml-tiny.bin", "ggml-metal.metal", "ggml-common.h"]
end

def caveats
Expand All @@ -38,10 +44,12 @@
EOS
end

test do

Check failure on line 47 in Formula/w/whisper-cpp.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

`brew test --verbose whisper-cpp` failed on macOS Sonoma (14) on Apple Silicon!

/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.1/bin/bundle clean ==> Testing whisper-cpp ==> /opt/homebrew/Cellar/whisper-cpp/1.6.0/bin/whisper-cpp jfk.wav -m for-tests-ggml-tiny.bin whisper_init_from_file_with_params_no_state: loading model from 'for-tests-ggml-tiny.bin' whisper_init_with_params_no_state: use gpu = 1 whisper_init_with_params_no_state: flash attn = 0 whisper_init_with_params_no_state: gpu_device = 0 whisper_init_with_params_no_state: dtw = 0 whisper_model_load: loading model whisper_model_load: n_vocab = 51865 whisper_model_load: n_audio_ctx = 1500 whisper_model_load: n_audio_state = 384 whisper_model_load: n_audio_head = 6 whisper_model_load: n_audio_layer = 4 whisper_model_load: n_text_ctx = 448 whisper_model_load: n_text_state = 384 whisper_model_load: n_text_head = 6 whisper_model_load: n_text_layer = 4 whisper_model_load: n_mels = 80 whisper_model_load: ftype = 1 whisper_model_load: qntvr = 0 whisper_model_load: type = 1 (tiny) whisper_model_load: adding 1608 extra tokens whisper_model_load: n_langs = 99 whisper_backend_init: using Metal backend ggml_metal_init: allocating ggml_metal_init: found device: Apple Paravirtual device ggml_metal_init: picking default device: Apple Paravirtual device ggml_metal_init: default.metallib not found, loading from source ggml_metal_init: GGML_METAL_PATH_RESOURCES = nil ggml_metal_init: error: could not use bundle path to find ggml-metal.metal, falling back to trying cwd ggml_metal_init: loading 'ggml-metal.metal' ggml_metal_init: error: Error Domain=MTLLibraryErrorDomain Code=3 "program_source:3:10: fatal error: 'ggml-common.h' file not found #include "ggml-common.h" ^~~~~~~~~~~~~~~ " UserInfo={NSLocalizedDescription=program_source:3:10: fatal error: 'ggml-common.h' file not found #include "ggml-common.h" ^~~~~~~~~~~~~~~ } whisper_backend_init: ggml_backend_metal_init() failed whisper_model_load: CPU total size = 77.11 MB whisper_model_load: model size = 0.00 MB whisper_model_load: WARN no tensors loaded from model file - assuming empty model for testing whisper_init_state: kv self size = 9.44 MB whisper_init_state: kv cross size = 9.44 MB whisper_init_state: kv pad size = 2.36 MB whisper_init_state: loading Core ML model from 'for-tests-ggml-tiny-encoder.mlmodelc' whisper_init_state: first run on a device may take a while ... whisper_init_state: failed to load Core ML model from 'for-tests-ggml-tiny-encoder.mlmodelc' error: failed to initialize whisper context Error: whisper-cpp: failed ::error::whisper-cpp: failed An exception occurred within a child process: BuildError: Failed executing: /opt/homebrew/Cellar/whisper-cpp/1.6.0/bin/whisper-cpp jfk.wav -m for-tests-ggml-tiny.bin /opt/homebrew/Library/Homebrew/formula.rb:3044:in `block in system' /opt/homebrew/Library/Homebrew/formula.rb:2980:in `open' /opt/homebrew/Library/Homebrew/formula.rb:2980:in `system' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11385/lib/types/private/methods/call_validation.rb:270:in `bind_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11385/lib/types/private/methods/call_validation.rb:270:in `validate_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11385/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added' /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/w/whisper-cpp.rb:46:in `block in <class:WhisperCpp>' /opt/homebrew/Library/Homebrew/formula.rb:2786:in `block (3 levels) in run_test' /opt/homebrew/Library/Homebrew/extend/kernel.rb:529:in `with_env' /opt/homebrew/Library/Homebrew/formula.rb:2785:in `block (2 levels) in run_test' /opt/homebrew/Library/Homebrew/formula.rb:1189:in `with_logging' /opt/homebrew/Library/Homebrew/formula.rb:2784:in `block in run_test' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `block in run' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `chdir' /opt/h

Check failure on line 47 in Formula/w/whisper-cpp.rb

View workflow job for this annotation

GitHub Actions / macOS 13-arm64

`brew test --verbose whisper-cpp` failed on macOS Ventura (13) on Apple Silicon!

/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.1/bin/bundle clean ==> Testing whisper-cpp ==> /opt/homebrew/Cellar/whisper-cpp/1.6.0/bin/whisper-cpp jfk.wav -m for-tests-ggml-tiny.bin whisper_init_from_file_with_params_no_state: loading model from 'for-tests-ggml-tiny.bin' whisper_init_with_params_no_state: use gpu = 1 whisper_init_with_params_no_state: flash attn = 0 whisper_init_with_params_no_state: gpu_device = 0 whisper_init_with_params_no_state: dtw = 0 whisper_model_load: loading model whisper_model_load: n_vocab = 51865 whisper_model_load: n_audio_ctx = 1500 whisper_model_load: n_audio_state = 384 whisper_model_load: n_audio_head = 6 whisper_model_load: n_audio_layer = 4 whisper_model_load: n_text_ctx = 448 whisper_model_load: n_text_state = 384 whisper_model_load: n_text_head = 6 whisper_model_load: n_text_layer = 4 whisper_model_load: n_mels = 80 whisper_model_load: ftype = 1 whisper_model_load: qntvr = 0 whisper_model_load: type = 1 (tiny) whisper_model_load: adding 1608 extra tokens whisper_model_load: n_langs = 99 whisper_backend_init: using Metal backend ggml_metal_init: allocating ggml_metal_init: found device: Apple Paravirtual device ggml_metal_init: picking default device: Apple Paravirtual device ggml_metal_init: default.metallib not found, loading from source ggml_metal_init: GGML_METAL_PATH_RESOURCES = nil ggml_metal_init: error: could not use bundle path to find ggml-metal.metal, falling back to trying cwd ggml_metal_init: loading 'ggml-metal.metal' ggml_metal_init: error: Error Domain=MTLLibraryErrorDomain Code=3 "program_source:3:10: fatal error: 'ggml-common.h' file not found #include "ggml-common.h" ^~~~~~~~~~~~~~~ " UserInfo={NSLocalizedDescription=program_source:3:10: fatal error: 'ggml-common.h' file not found #include "ggml-common.h" ^~~~~~~~~~~~~~~ } whisper_backend_init: ggml_backend_metal_init() failed whisper_model_load: CPU total size = 77.11 MB whisper_model_load: model size = 0.00 MB whisper_model_load: WARN no tensors loaded from model file - assuming empty model for testing whisper_init_state: kv self size = 9.44 MB whisper_init_state: kv cross size = 9.44 MB whisper_init_state: kv pad size = 2.36 MB whisper_init_state: loading Core ML model from 'for-tests-ggml-tiny-encoder.mlmodelc' whisper_init_state: first run on a device may take a while ... whisper_init_state: failed to load Core ML model from 'for-tests-ggml-tiny-encoder.mlmodelc' error: failed to initialize whisper context Error: whisper-cpp: failed ::error::whisper-cpp: failed An exception occurred within a child process: BuildError: Failed executing: /opt/homebrew/Cellar/whisper-cpp/1.6.0/bin/whisper-cpp jfk.wav -m for-tests-ggml-tiny.bin /opt/homebrew/Library/Homebrew/formula.rb:3044:in `block in system' /opt/homebrew/Library/Homebrew/formula.rb:2980:in `open' /opt/homebrew/Library/Homebrew/formula.rb:2980:in `system' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11385/lib/types/private/methods/call_validation.rb:270:in `bind_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11385/lib/types/private/methods/call_validation.rb:270:in `validate_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11385/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added' /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/w/whisper-cpp.rb:46:in `block in <class:WhisperCpp>' /opt/homebrew/Library/Homebrew/formula.rb:2786:in `block (3 levels) in run_test' /opt/homebrew/Library/Homebrew/extend/kernel.rb:529:in `with_env' /opt/homebrew/Library/Homebrew/formula.rb:2785:in `block (2 levels) in run_test' /opt/homebrew/Library/Homebrew/formula.rb:1189:in `with_logging' /opt/homebrew/Library/Homebrew/formula.rb:2784:in `block in run_test' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `block in run' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `chdir' /opt/h

Check failure on line 47 in Formula/w/whisper-cpp.rb

View workflow job for this annotation

GitHub Actions / macOS 12-arm64

`brew test --verbose whisper-cpp` failed on macOS Monterey (12) on Apple Silicon!

/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.1/bin/bundle clean ==> Testing whisper-cpp ==> /opt/homebrew/Cellar/whisper-cpp/1.6.0/bin/whisper-cpp jfk.wav -m for-tests-ggml-tiny.bin whisper_init_from_file_with_params_no_state: loading model from 'for-tests-ggml-tiny.bin' whisper_init_with_params_no_state: use gpu = 1 whisper_init_with_params_no_state: flash attn = 0 whisper_init_with_params_no_state: gpu_device = 0 whisper_init_with_params_no_state: dtw = 0 whisper_model_load: loading model whisper_model_load: n_vocab = 51865 whisper_model_load: n_audio_ctx = 1500 whisper_model_load: n_audio_state = 384 whisper_model_load: n_audio_head = 6 whisper_model_load: n_audio_layer = 4 whisper_model_load: n_text_ctx = 448 whisper_model_load: n_text_state = 384 whisper_model_load: n_text_head = 6 whisper_model_load: n_text_layer = 4 whisper_model_load: n_mels = 80 whisper_model_load: ftype = 1 whisper_model_load: qntvr = 0 whisper_model_load: type = 1 (tiny) whisper_model_load: adding 1608 extra tokens whisper_model_load: n_langs = 99 whisper_backend_init: using Metal backend ggml_metal_init: allocating ggml_metal_init: found device: Apple Paravirtual device ggml_metal_init: picking default device: Apple Paravirtual device ggml_metal_init: default.metallib not found, loading from source ggml_metal_init: GGML_METAL_PATH_RESOURCES = nil ggml_metal_init: error: could not use bundle path to find ggml-metal.metal, falling back to trying cwd ggml_metal_init: loading 'ggml-metal.metal' ggml_metal_init: error: Error Domain=MTLLibraryErrorDomain Code=3 "program_source:3:10: fatal error: 'ggml-common.h' file not found #include "ggml-common.h" ^~~~~~~~~~~~~~~ " UserInfo={NSLocalizedDescription=program_source:3:10: fatal error: 'ggml-common.h' file not found #include "ggml-common.h" ^~~~~~~~~~~~~~~ } whisper_backend_init: ggml_backend_metal_init() failed whisper_model_load: CPU total size = 77.11 MB whisper_model_load: model size = 0.00 MB whisper_model_load: WARN no tensors loaded from model file - assuming empty model for testing whisper_init_state: kv self size = 9.44 MB whisper_init_state: kv cross size = 9.44 MB whisper_init_state: kv pad size = 2.36 MB whisper_init_state: loading Core ML model from 'for-tests-ggml-tiny-encoder.mlmodelc' whisper_init_state: first run on a device may take a while ... whisper_init_state: failed to load Core ML model from 'for-tests-ggml-tiny-encoder.mlmodelc' error: failed to initialize whisper context Error: whisper-cpp: failed ::error::whisper-cpp: failed An exception occurred within a child process: BuildError: Failed executing: /opt/homebrew/Cellar/whisper-cpp/1.6.0/bin/whisper-cpp jfk.wav -m for-tests-ggml-tiny.bin /opt/homebrew/Library/Homebrew/formula.rb:3044:in `block in system' /opt/homebrew/Library/Homebrew/formula.rb:2980:in `open' /opt/homebrew/Library/Homebrew/formula.rb:2980:in `system' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11385/lib/types/private/methods/call_validation.rb:270:in `bind_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11385/lib/types/private/methods/call_validation.rb:270:in `validate_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11385/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added' /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/w/whisper-cpp.rb:46:in `block in <class:WhisperCpp>' /opt/homebrew/Library/Homebrew/formula.rb:2786:in `block (3 levels) in run_test' /opt/homebrew/Library/Homebrew/extend/kernel.rb:529:in `with_env' /opt/homebrew/Library/Homebrew/formula.rb:2785:in `block (2 levels) in run_test' /opt/homebrew/Library/Homebrew/formula.rb:1189:in `with_logging' /opt/homebrew/Library/Homebrew/formula.rb:2784:in `block in run_test' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `block in run' /opt/homebrew/Library/Homebrew/mktemp.rb:75:in `chdir' /opt/h
cp [pkgshare/"jfk.wav", pkgshare/"for-tests-ggml-tiny.bin", pkgshare/"ggml-metal.metal"], testpath

system "#{bin}/whisper-cpp", "samples", "-m", "for-tests-ggml-tiny.bin"
cp [pkgshare/"jfk.wav",
pkgshare/"for-tests-ggml-tiny.bin",
pkgshare/"ggml-metal.metal",
pkgshare/"ggml-common.h"], testpath
system "#{bin}/whisper-cpp", "jfk.wav", "-m", "for-tests-ggml-tiny.bin"
assert_equal 0, $CHILD_STATUS.exitstatus, "whisper-cpp failed with exit code #{$CHILD_STATUS.exitstatus}"
end
end