]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
cli : print color scheme info for --print-colors (#3141)
authorDaniel Bevenius <redacted>
Mon, 12 May 2025 08:43:04 +0000 (10:43 +0200)
committerGitHub <redacted>
Mon, 12 May 2025 08:43:04 +0000 (10:43 +0200)
This commit adds a description of the color scheme used in the CLI
when the --print-colors option is enabled.

The motivation for this is that it is not immediately clear what the
color scheme is when using the CLI with the --print-colors option.

Example output:
```console
$ ./build/bin/whisper-cli -f samples/jfk.wav --print-colors
...

main: color scheme: red (low confidence), yellow (medium), green (high confidence)

[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.
```
The description will not be dispayed if the `--no-prints` options is
set.

Refs: https://github.com/ggml-org/whisper.cpp/issues/3135

examples/cli/cli.cpp

index fccfd13eb0da8a05c1c4e7fb637486011da5a5e5..0cc3d38f3f4d4a48469a8c662f5714d201d59211 100644 (file)
@@ -1081,6 +1081,9 @@ int main(int argc, char ** argv) {
                     params.tinydiarize ? "tdrz = 1, " : "",
                     params.no_timestamps ? 0 : 1);
 
+            if (params.print_colors) {
+                fprintf(stderr, "%s: color scheme: red (low confidence), yellow (medium), green (high confidence)\n", __func__);
+            }
             fprintf(stderr, "\n");
         }