natrys / whisper.el

Speech-to-Text interface for Emacs using OpenAI's whisper model and whisper.cpp as inference engine.
140 stars 10 forks source link

Cannot open load file: No such file or directory, whisper #7

Closed liar666 closed 1 year ago

liar666 commented 1 year ago

Hi,

I've git cloned the whisper.el and whisper.cpp repos and added the configuration lines in my (Doom)Emacs config.org as such:

(use-package whisper
  :load-path "$HOME/.doom.d/packages/whisper.el"
  :bind ("C-r" . whisper-run)  ;; just first testing
  :config
  (setq whisper-install-directory "$HOME/.doom.d/packages/whisper.cpp"
        whisper-model "base"
        whisper-language "en"
        whisper-translate nil))

When I hit the "bound" keys, I get the following error message: command-execute: Cannot open load file: No such file or directory, whisper

What is strange:

Any idea where is/are the problem/s?

natrys commented 1 year ago

Just to confirm, you don't actually have the $HOME in those path strings right? This is not shell, Emacs has no understanding or means of interpolating variables like that. You should just provide the expanded absolute path (or relative path is considered relative to user-emacs-directory) even though tilde should also work there as use-package knows how to expand that.

I believe the errors are saying that Emacs can't find whisper.el module at all. I presume that cloned whisper.el could be found in ~/.doom.d/packages/whisper.el location? In that case the :load-path should just be ~/.doom.d/packages/whisper.el.

Also openai-whisper has no bearing to this, so the actual whisper command should be irrelevant. Please check if the above load-path works. You shouldn't need to install whisper.cpp manually, but fwiw the purpose of whisper-install-directory is to point to where whisper.cpp would be automatically installed. Therefore if you insist on setting it manually, you would need to set that to the parent directory of whisper.cpp (again, don't use $HOME there, use tilde).

liar666 commented 1 year ago

That were the problems. Thanks a lot for your help!

natrys commented 1 year ago

Alright, closing it then.