AlexHung29629 commited on
Commit
d3c0181
1 Parent(s): 161d998

Update ultravox_processing.py

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