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

Does this works for Apple silicon? #12

Open
tiero opened this issue Oct 17, 2023 · 7 comments
Open

Does this works for Apple silicon? #12

tiero opened this issue Oct 17, 2023 · 7 comments

Comments

@tiero
Copy link

tiero commented Oct 17, 2023

I downloaded the binary on Mac M1 Max, even if says x86_64 seems to be able to be run. But I can't transcribe

whisper --model tiny.en sample.wav
Downloaded https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.en.bin to /Users/tiero/Library/Caches/whisper/models/tiny.en.bin
  [00:00:11] [##################################################################################] 74.10 MiB/74.10 MiB (6.73 MiB/s, 0s)whisper_init_from_file_no_state: loading model from '/Users/tiero/Library/Caches/whisper/models/tiny.en.bin'
whisper_model_load: loading model
whisper_model_load: n_vocab       = 51864
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
whisper_model_load: mem required  =  201.00 MB (+    3.00 MB per decoder)
whisper_model_load: adding 1607 extra tokens
[1]    28367 illegal hardware instruction  whisper --model tiny.en sample.wav
@tiero
Copy link
Author

tiero commented Oct 17, 2023

I tried to pull the repo and build on my Mac and I get the following error

error: failed to run custom build command for `whisper-rs-sys v0.6.0`
  --- stderr
  thread 'main' panicked at 'Failed to run `cmake`: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /Users/tiero/.cargo/registry/src/index.crates.io-6f17d22bba15001f/whisper-rs-sys-0.6.0/build.rs:107:29
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

@tiero
Copy link
Author

tiero commented Oct 17, 2023

Ok that error is fixed by installing cmake on my system, I improved the documentation to allow Mac developers to build the solution locally see the PR #13

@tiero
Copy link
Author

tiero commented Oct 17, 2023

I modified the release action to also cross-compile for arm64 architecture for Darwin #14

@tiero
Copy link
Author

tiero commented Oct 17, 2023

I tried to run the CLI with cargo run as below, but It gives me this error. The file jfk.wav is the root directory where.

cargo run -- --model tiny.en --lang auto jfk.wav
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s
     Running `target/debug/whisper --model tiny.en --lang auto jfk.wav`
whisper_init_from_file_no_state: loading model from '/Users/tiero/Library/Caches/whisper/models/tiny.en.bin'
whisper_model_load: loading model
whisper_model_load: n_vocab       = 51864
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
whisper_model_load: mem required  =  201.00 MB (+    3.00 MB per decoder)
whisper_model_load: adding 1607 extra tokens
whisper_model_load: model ctx     =   73.62 MB
whisper_model_load: model size    =   73.54 MB
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: No such file or directory (os error 2)', src/main.rs:59:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I also tried passing the absolute path, but same result

@tiero
Copy link
Author

tiero commented Oct 17, 2023

I think the error comes from the fact the transcribe method assumes ffmpeg is available and installed in the user system. on mac would be brew insyall ffmpeg This seems very limiting if requires the user to have to install a program to work. any plans to have an alternative that will allow the binary to be really portable?

@djmango
Copy link

djmango commented Nov 5, 2024

Were you ever able to resolve this? running into same issue on apple silcon. or find an alternative

@tiero
Copy link
Author

tiero commented Nov 5, 2024

i have my fork here https://github.com/tiero/whisperd

GitHub
The OpenAI Whisper speech-to-text model as a simple HTTP server - GitHub - tiero/whisperd: The OpenAI Whisper speech-to-text model as a simple HTTP server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants