Skip to content

Commit d5b81e1

Browse files
Delete redundancy for loop checks. (#35288)
Signed-off-by: zhanluxianshen <[email protected]>
1 parent d0f3221 commit d5b81e1

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/transformers/audio_utils.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -689,16 +689,12 @@ def spectrogram_batch(
689689
if hop_length <= 0:
690690
raise ValueError("hop_length must be greater than zero")
691691

692-
# Check the dimensions of the waveform
692+
# Check the dimensions of the waveform , and if waveform is complex
693693
for waveform in waveform_list:
694694
if waveform.ndim != 1:
695695
raise ValueError(f"Input waveform must have only one dimension, shape is {waveform.shape}")
696-
697-
# Check if waveform is complex
698-
for waveform in waveform_list:
699696
if np.iscomplexobj(waveform):
700697
raise ValueError("Complex-valued input waveforms are not currently supported")
701-
702698
# Center pad the waveform
703699
if center:
704700
padding = [(int(frame_length // 2), int(frame_length // 2))]

0 commit comments

Comments
 (0)