From 4b8237da1bb9ef6ad7c2ef858af9e6d05c8cd93b Mon Sep 17 00:00:00 2001 From: Guillaume Klein Date: Wed, 22 Feb 2023 10:28:04 +0100 Subject: [PATCH] Strip the leading space before computing the compression ratio --- faster_whisper/transcribe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/faster_whisper/transcribe.py b/faster_whisper/transcribe.py index 1dd9d4a..dc994cf 100644 --- a/faster_whisper/transcribe.py +++ b/faster_whisper/transcribe.py @@ -338,7 +338,7 @@ class WhisperModel: avg_log_prob = cum_log_prob / (seq_len + 1) tokens = result.sequences_ids[0] - text = self.decode_text_tokens(tokens) + text = self.decode_text_tokens(tokens).strip() compression_ratio = get_compression_ratio(text) if (