AlexHung29629 commited on
Commit
55a1b66
·
verified ·
1 Parent(s): fe35a68

Update ultravox_processing.py

Browse files
Files changed (1) hide show
  1. ultravox_processing.py +1 -1
ultravox_processing.py CHANGED
@@ -141,7 +141,7 @@ class UltravoxProcessor(transformers.ProcessorMixin):
141
  assert sampling_rate is not None, "Sampling rate must be provided."
142
  audio_len = 30 * sampling_rate
143
  else:
144
- audio_len = audio.shape[-1]
145
  # It's guaranteed that the number of frames is less than or equal to this amount.
146
  # For Whisper this is exact AFAICT, but for Wav2Vec2 it's an upper bound.
147
  # Currently, StackAudioFrames makes sure an over-estimation won't cause issues by padding the audio embeddings.
 
141
  assert sampling_rate is not None, "Sampling rate must be provided."
142
  audio_len = 30 * sampling_rate
143
  else:
144
+ audio_len = max([a.shape[-1] for a in audio])
145
  # It's guaranteed that the number of frames is less than or equal to this amount.
146
  # For Whisper this is exact AFAICT, but for Wav2Vec2 it's an upper bound.
147
  # Currently, StackAudioFrames makes sure an over-estimation won't cause issues by padding the audio embeddings.