Unverified Commit 1ba89dc2 authored by Yoach Lacombe's avatar Yoach Lacombe Committed by GitHub
Browse files

Fix WhisperNoSpeechDetection when input is full silence (#29065)

fix total silence input with no_speech_threshold
parent 697f05ba
...@@ -141,8 +141,10 @@ def _pad_to_max_length(current_segments, pad_token_id, padding="right", bos_toke ...@@ -141,8 +141,10 @@ def _pad_to_max_length(current_segments, pad_token_id, padding="right", bos_toke
sequences.append(sequence) sequences.append(sequence)
max_total_length = max(max_total_length, len(sequences[-1])) max_total_length = max(max_total_length, len(sequences[-1]))
else: elif bos_token_tensor is not None:
sequences.append(bos_token_tensor) sequences.append(bos_token_tensor)
else:
sequences.append(torch.tensor([]))
for i in range(len(current_segments)): for i in range(len(current_segments)):
pad_length = max_total_length - len(sequences[i]) pad_length = max_total_length - len(sequences[i])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment