whisper.cpp icon indicating copy to clipboard operation
whisper.cpp copied to clipboard

silent whisper_model_load

Open jaybinks opened this issue 1 year ago • 1 comments

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)

jaybinks avatar Feb 14 '23 23:02 jaybinks

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.

ggerganov avatar Feb 15 '23 18:02 ggerganov

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

llimllib avatar Jun 27 '23 03:06 llimllib

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.

llimllib avatar Jun 27 '23 15:06 llimllib