Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
1ba89dc2
Unverified
Commit
1ba89dc2
authored
Mar 08, 2024
by
Yoach Lacombe
Committed by
GitHub
Mar 08, 2024
Browse files
Fix WhisperNoSpeechDetection when input is full silence (#29065)
fix total silence input with no_speech_threshold
parent
697f05ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
src/transformers/models/whisper/generation_whisper.py
src/transformers/models/whisper/generation_whisper.py
+3
-1
No files found.
src/transformers/models/whisper/generation_whisper.py
View file @
1ba89dc2
...
@@ -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
]))
el
s
e
:
el
if
bos_token_tensor
is
not
Non
e
:
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
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment