update decoding strategy
Browse files
app.py
CHANGED
@@ -125,7 +125,7 @@ def transcribe_one(model, audio_path):
|
|
125 |
print(f"Detected language: {max(probs, key=probs.get)}")
|
126 |
lang = max(probs, key=probs.get)
|
127 |
# decode the audio
|
128 |
-
options = whisper.DecodingOptions(
|
129 |
result = whisper.decode(model, mel, options)
|
130 |
|
131 |
# print the recognized text
|
|
|
125 |
print(f"Detected language: {max(probs, key=probs.get)}")
|
126 |
lang = max(probs, key=probs.get)
|
127 |
# decode the audio
|
128 |
+
options = whisper.DecodingOptions(temperature=1.0, best_of=5, fp16=False if device == torch.device("cpu") else True, sample_len=100)
|
129 |
result = whisper.decode(model, mel, options)
|
130 |
|
131 |
# print the recognized text
|