From ec4e16dba437ddf5ae400ed152ff08b67c567c66 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 14 May 2025 19:21:48 +0200 Subject: [PATCH 1/2] examples : add --print-confidence option to cli (whisper/3150) * examples : add --print-confidence option to cli This commit adds a new command-line option `--print-confidence` to the whisper-cli. When enabled, this option prints the confidence level of each token in the transcribed text using ANSI formatting codes. The confidence levels are represented using different styles: ```console main: confidence: highlighted (low confidence), underlined (medium), dim (high confidence) ``` Refs: https://github.com/ggml-org/whisper.cpp/issues/3135 --- examples/common.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/examples/common.h b/examples/common.h index 1aa763817e..8f99df7dd3 100644 --- a/examples/common.h +++ b/examples/common.h @@ -294,6 +294,26 @@ const std::vector k_colors = { set_xterm256_foreground( 78, 178, 101), }; +// ANSI formatting codes +static std::string set_inverse() { + return "\033[7m"; +} + +static std::string set_underline() { + return "\033[4m"; +} + +static std::string set_dim() { + return "\033[2m"; +} + +// Style scheme for different confidence levels +const std::vector k_styles = { + set_inverse(), // Low confidence - inverse (highlighted) + set_underline(), // Medium confidence - underlined + set_dim(), // High confidence - dim +}; + // // Other utils // From 86650c6ec81ff45d826361f79020d3587a37622b Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Tue, 20 May 2025 15:47:13 +0300 Subject: [PATCH 2/2] sync : whisper.cpp ggml-ci --- scripts/sync-whisper.last | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/sync-whisper.last b/scripts/sync-whisper.last index a418b306f0..019aaf73f3 100644 --- a/scripts/sync-whisper.last +++ b/scripts/sync-whisper.last @@ -1 +1 @@ -f89056057511a1657af90bb28ef3f21e5b1f33cd +62dc8f7d7b72ca8e75c57cd6a100712c631fa5d5