Skip to content

Conversation

@CsBigDataHub
Copy link

add whisper-curl-path defcustom to allow specifying curl executable location
set :type for whisper-transcription-buffer-namer to 'function for clarity
use whisper-curl-path in process command instead of hardcoded "curl"
comment out directory deletion on failed manual install for safety

Note: do not delete the directory if downloading model fails

This commit enhances the script's flexibility by allowing users to provide their own whisper.cpp executable and model files, bypassing the automatic installation and download process.

This is particularly useful for users who:

    Install whisper.cpp using a package manager like Homebrew.

    Prefer to manage their model files in a centralized directory.

Changes introduced:

    whisper-cli-path: A new user option to specify the absolute path to the whisper-cli executable. If set, the script will use this executable directly.

    whisper-models-directory: A new user option to specify the path to a directory containing the ggml-*.bin model files.

    The installation and model download logic in whisper--check-install-and-run is now skipped if these variables are configured, preventing unnecessary installation attempts.

This makes the package more accommodating to various user workflows and environments without altering the default behavior for new users.
add whisper-curl-path defcustom to allow specifying curl executable location
set :type for whisper-transcription-buffer-namer to 'function for clarity
use whisper-curl-path in process command instead of hardcoded "curl"
comment out directory deletion on failed manual install for safety

 Note: do not delete the directory if downloading model fails
@natrys
Copy link
Owner

natrys commented Aug 27, 2025

So I am not, in isolation, fundamentally opposed to the idea. However, because we already have too many variables, I would have to push back a little. If you have curl in a non-standard location, would it not make sense to add that to your $PATH?

Or if you are opposed to doing that from outside (maybe because it would have system-wide effect), from inside Emacs you can still add a path to exec-path variable that would only work in Emacs. Is that not just as convenient?

Note: do not delete the directory if downloading model fails

I guess if some model download fails, it's not nice that other already downloaded files gets deleted. However the clean-up is mainly there because of compilation failures, not download failures. If there are some weird reasons why compilation couldn't complete, it's definitely best to start from scratch again.

Unfortunately we can't differentiate compilation failure with download failure. Maybe we could do make clean but for my sanity if I can hedge against some really weird corner case with a blunt solution, I will take the trade-off if the other cost is bandwidth for you.

set :type for whisper-transcription-buffer-namer to 'function for clarity

This is a good idea, thanks.

@CsBigDataHub
Copy link
Author

CsBigDataHub commented Aug 27, 2025

So curl is packaged by default in MacOs and that version is old.

Here is the MacOS packaged version -

/usr/bin/curl --version
curl 8.7.1 (x86_64-apple-darwin24.0) libcurl/8.7.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.64.0
Release-Date: 2024-03-27
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL threadsafe UnixSockets

Here is Homebrew installed version

/opt/homebrew/opt/curl/bin/curl --version
curl 8.15.0 (aarch64-apple-darwin24.4.0) libcurl/8.15.0 OpenSSL/3.5.2 zlib/1.2.12 brotli/1.1.0 zstd/1.5.7 AppleIDN libssh2/1.11.1 nghttp2/1.66.0 ngtcp2/1.14.0 nghttp3/1.11.0 librtmp/2.3
Release-Date: 2025-07-16
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd

this location has already been added to path /opt/homebrew/opt/curl/bin but whatever reason emacs always picks /usr/bin/curl, hence the variable to define the path.

My company blocks huggingface domains, so I had to download pt(PyTorch) files and convert it to ggml. While the build is successful, I was not able to download the models and the directory disappears.
So I needed to comment this line out and manually download, convert and place the models in the location.

@natrys
Copy link
Owner

natrys commented Aug 27, 2025

Thanks for the explanation, makes sense in that case and I will get to it later.

Though I am a little perplexed about why Emacs would pick the wrong curl. Maybe $PATH had the wrong order/precedence? Can you check that your exec-path variable has the /opt/homebrew/opt/curl/bin/ above/earlier than /usr/bin/? You can probably make sure it's at the top by doing:

(setq exec-path (remove "/opt/homebrew/opt/curl/bin" exec-path)) ;; might not be at the top initially, so remove first
(setq exec-path (cons "/opt/homebrew/opt/curl/bin" exec-path))

@CsBigDataHub
Copy link
Author

(setq exec-path (remove "/opt/homebrew/opt/curl/bin" exec-path)) ;; might not be at the top initially, so remove first
(setq exec-path (cons "/opt/homebrew/opt/curl/bin" exec-path))

This worked that's. It was a priority issue after all.

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

Successfully merging this pull request may close these issues.

2 participants