added beam search for short audio annotations

This commit is contained in:
Plachta
2023-05-23 21:30:58 +08:00
parent bf560f2a68
commit 34c5d91a85
+1 -1
View File
@@ -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