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
bcd23a54
"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "1121ce9f98f718d67c3976dd30bb44933730ad56"
Unverified
Commit
bcd23a54
authored
Mar 04, 2024
by
Yoach Lacombe
Committed by
GitHub
Mar 04, 2024
Browse files
Avoid edge case in audio utils (#28836)
parent
7941769e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
src/transformers/audio_utils.py
src/transformers/audio_utils.py
+6
-0
No files found.
src/transformers/audio_utils.py
View file @
bcd23a54
...
@@ -412,6 +412,12 @@ def spectrogram(
...
@@ -412,6 +412,12 @@ def spectrogram(
if
np
.
iscomplexobj
(
waveform
):
if
np
.
iscomplexobj
(
waveform
):
raise
ValueError
(
"Complex-valued input waveforms are not currently supported"
)
raise
ValueError
(
"Complex-valued input waveforms are not currently supported"
)
if
power
is
None
and
mel_filters
is
not
None
:
raise
ValueError
(
"You have provided `mel_filters` but `power` is `None`. Mel spectrogram computation is not yet supported for complex-valued spectrogram."
"Specify `power` to fix this issue."
)
# center pad the waveform
# center pad the waveform
if
center
:
if
center
:
padding
=
[(
int
(
frame_length
//
2
),
int
(
frame_length
//
2
))]
padding
=
[(
int
(
frame_length
//
2
),
int
(
frame_length
//
2
))]
...
...
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