alex-ht commited on
Commit
f29a23c
1 Parent(s): 7f2cfee
Files changed (1) hide show
  1. ultravox_processing.py +1 -1
ultravox_processing.py CHANGED
@@ -151,7 +151,7 @@ class UltravoxProcessor(transformers.ProcessorMixin):
151
  def cnn_out_len(in_len, kernel, stride=1, padding=1, dilation=1):
152
  return np.floor((in_len + (2*padding) - (dilation * (kernel - 1)) - 1)/stride + 1)
153
  nb_encoder_frames = [cnn_out_len(cnn_out_len(feat_len, kernel=3), kernel=3, stride=2) for feat_len in data["audio_len"]]
154
- data["audio_token_len"] = [int(np.ceil(x/self.stack_factor)) for x in nb_encoder_frames]
155
 
156
  if text is not None:
157
  assert isinstance(
 
151
  def cnn_out_len(in_len, kernel, stride=1, padding=1, dilation=1):
152
  return np.floor((in_len + (2*padding) - (dilation * (kernel - 1)) - 1)/stride + 1)
153
  nb_encoder_frames = [cnn_out_len(cnn_out_len(feat_len, kernel=3), kernel=3, stride=2) for feat_len in data["audio_len"]]
154
+ data["audio_token_len"] = [int(x//self.stack_factor) for x in nb_encoder_frames]
155
 
156
  if text is not None:
157
  assert isinstance(