mirror of
https://github.com/shirayu/whispering.git
synced 2024-11-25 10:21:00 +00:00
Add break for fallback
This commit is contained in:
parent
0ad6976d46
commit
57ca9e9102
1 changed files with 5 additions and 3 deletions
|
@ -109,10 +109,10 @@ class WhisperStreamingTranscriber:
|
||||||
and result.avg_logprob < self.config.logprob_threshold
|
and result.avg_logprob < self.config.logprob_threshold
|
||||||
for result in results
|
for result in results
|
||||||
]
|
]
|
||||||
|
if any(needs_fallback):
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"Fall back with temperature: {t}, needs_fallback: {needs_fallback}"
|
f"Fall back with temperature: {t}, needs_fallback: {needs_fallback}"
|
||||||
)
|
)
|
||||||
if any(needs_fallback):
|
|
||||||
_decode_options2: DecodingOptions = self._get_decoding_options(
|
_decode_options2: DecodingOptions = self._get_decoding_options(
|
||||||
t=t,
|
t=t,
|
||||||
prompt=self.buffer_tokens,
|
prompt=self.buffer_tokens,
|
||||||
|
@ -127,6 +127,8 @@ class WhisperStreamingTranscriber:
|
||||||
np.nonzero(needs_fallback)[0]
|
np.nonzero(needs_fallback)[0]
|
||||||
):
|
):
|
||||||
results[original_index] = retries[retry_index]
|
results[original_index] = retries[retry_index]
|
||||||
|
else:
|
||||||
|
break
|
||||||
logger.debug(f"# of results: {len(results)}")
|
logger.debug(f"# of results: {len(results)}")
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue