mirror of
https://github.com/openai/whisper.git
synced 2025-03-30 14:28:27 +00:00
Return the best only if all fallbacks failed
This commit is contained in:
parent
a72a04414b
commit
f677284d11
@ -148,6 +148,7 @@ def transcribe(
|
||||
temperatures = (
|
||||
[temperature] if isinstance(temperature, (int, float)) else temperature
|
||||
)
|
||||
decode_result = None
|
||||
results = {}
|
||||
|
||||
for t in temperatures:
|
||||
@ -183,8 +184,11 @@ def transcribe(
|
||||
needs_fallback = False # silence
|
||||
if not needs_fallback:
|
||||
break
|
||||
else:
|
||||
# all failed
|
||||
return max(results.values(), key=lambda r: r.avg_logprob)
|
||||
|
||||
return max(results.values(), key=lambda r: r.avg_logprob)
|
||||
return decode_result
|
||||
|
||||
seek = 0
|
||||
input_stride = exact_div(
|
||||
|
Loading…
x
Reference in New Issue
Block a user