whisper.cpp
whisper.cpp copied to clipboard
silent whisper_model_load
Is it possible to stop the output when loading a model. Maybe a "Silent" boolean, when calling Whisper_init or similar ?
TBH Id imagine this should default to silent.
exposing the output that currently goes to STDOUT, would also be helpful. (rather than just dumping to STDOUT)
Yup, logging settings will be exposed through the API at some point and will solve similar issues.
Btw, currently whisper prints everything related to internal processing to STDERR, not STDOUT.
So you can for example forward it to /dev/null
as a temporary solution:
$ ./main -m ./models/ggml-base.en.bin ./samples/jfk.wav 2> /dev/null
[00:00:00.000 --> 00:00:11.000] And so my fellow Americans, ask not what your country can do for you, ask what you can do for your country.
This is harder when using whisper via the bindings, it's possible but quite difficult from go for example to close the program's own stderr then re-attach it after the model load
In case anybody else needs to do it in go, it took me quite a bit of work to figure out how to redirect standard output such that it works for linked C libraries.
Here's where I do it: https://github.com/llimllib/blisper/blob/79643bb6e2052d0cdb0df38b8f98fba31209235c/main.go#L176-L194
Which calls the fakestdio package here: https://github.com/llimllib/blisper/blob/79643bb6e2052d0cdb0df38b8f98fba31209235c/fakestdio/fakestdio.go
The info on how to do this came from this Eli Bendersky article.
Also, this means that my program doesn't work in Windows, and I have no idea how to make standard output redirection work properly on that OS.