-
Notifications
You must be signed in to change notification settings - Fork 12
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
Document using an already install whisper.cpp #16
Comments
Ah never mind! Support is already there I just couldn't find it in the README? Lines 111 to 126 in 2d541ac
|
Actually it is documented in the README (although I will take this as an unwitting proof of the fact that the README had grown too bloated due to too many variables). In any case, would whisper.el even work with the nix package? iirc nix store paths are read only, whereas whisper.el basically presumes that downloaded models are in the relative You would basically have to override |
To clarify, I read the part about using a different tool, but not an already installed whisper. It has a fix where it installs to the local directory. This would need to install to somewhere that |
That part is also handled by the same variable, by setting it to I could maybe add couple more variables like whispercpp binary name, or custom model directory just for the nix package, but that imo feels like more pain than worth, though might become necessary in future if whisper.cpp is packaged by more distros and people want to use that. In any case if you want to just use the nixpkgs version, it's not that much extra effort today (though you would lose the automatic download and quantization feature of whisper.el). Assuming you are at $ whisper-cpp-download-ggml-model base The whisper.el configuration would be: (setq whisper-install-whispercpp nil)
(defun whisper--nix-command (input-file)
`("whisper-cpp"
"--model" ,(expand-file-name (concat "~/models/" "ggml-" whisper-model ".bin"))
,@(when whisper-use-threads (list "--threads" (number-to-string whisper-use-threads)))
,@(when whisper-translate '("--translate"))
,@(when whisper-show-progress-in-mode-line '("--print-progress"))
"--language" ,whisper-language
"--no-timestamps"
"--file" ,input-file))
(advice-add 'whisper-command :override #'whisper--nix-command) I pushed a commit earlier to recognise "whisper-cpp" from nix as indeed whisper.cpp from name so that you can still see transcription progress in modeline which is whisper.cpp specific feature. But that's probably all I want to do for now, aside from adding the recipe here in wiki and mention it in README somewhere. |
Instructions for how to configure whisper.el after installing the pre-compiled version of whisper.cpp package available from MSYS2 would be helpful for Windows users. I set From looking at the code, I'm not sure how Windows is supposed to get this value since the Describing how to tell whisper.el which model to use and where to find it would also be helpful when using the MSYS2 package for whisper.cpp since the default location (models folder under installation root folder) is no longer relevant. |
Hi @gtusr, I think we mentioned that this needs to be manually set to whatever is the audio device, unless you are on Linux. I have basically not used Windows in over a decade so don't really know what goes here. The trick with pulse works in Linux because it abstracts away the underlying hardware, otherwise this needs to be the code/id of your specific hardware which is different for everybody. If the ffmpeg from msys2 or whatever you use supports this, then the following command may show what are the appropriate devices you have: ffmpeg -list_devices true -f dshow -i dummy (according to this you may need to add
I think the above comment I wrote regarding Nix still applies here. Assuming you manually downloaded the models and put it in Although since whisper.cpp compilation doesn't require more than a compiler, have you tried just compiling it yourself in msys? Then you can set |
This command tells me that the microphone is "Microphone Array (2- Realtek High Definition Audio(SST))" but exits by reporting the following error: "Error opening input: Immediate exit requested. Error opening input file dummy." Not sure if this error is at all relevant since file dummy does not exist. In any event, whisper.el now reports that it is recording audio after I run I know that the underlying whisper.cpp from MSYS2 is working because I can transcribe the jfk.wav sample correctly from the command line. I also explicitly added the full pathname for the model to the --model parameter to no avail. |
Indeed the error isn't relevant, you just need the microphone name from it. I presume you tried setting Anyway sounds like ffmpeg is failing for some reason. Unfortunately error reporting is not great here. If you could try instruction from this comment, maybe you can get logs about exactly why ffmpeg is failing. |
I'd love to be able to use the whisper that's already installed, for example the one that's in nixpkgs. https://github.com/NixOS/nixpkgs/blob/nixos-23.05/pkgs/tools/audio/openai-whisper-cpp/default.nix#L51
The installation works great though!
The text was updated successfully, but these errors were encountered: