From 34c5d91a85aeb1baee55207307a34f62916dd3fe Mon Sep 17 00:00:00 2001 From: Plachta Date: Tue, 23 May 2023 21:30:58 +0800 Subject: [PATCH] added beam search for short audio annotations --- scripts/short_audio_transcribe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/short_audio_transcribe.py b/scripts/short_audio_transcribe.py index 95d670e..0627472 100644 --- a/scripts/short_audio_transcribe.py +++ b/scripts/short_audio_transcribe.py @@ -23,7 +23,7 @@ def transcribe_one(audio_path): print(f"Detected language: {max(probs, key=probs.get)}") lang = max(probs, key=probs.get) # decode the audio - options = whisper.DecodingOptions() + options = whisper.DecodingOptions(beam_size=5, best_of=5) result = whisper.decode(model, mel, options) # print the recognized text