fdugyt commited on
Commit
e4e8324
·
verified ·
1 Parent(s): 4a52ecf

Update modeling_moss_audio_tokenizer.py

Browse files
Files changed (1) hide show
  1. modeling_moss_audio_tokenizer.py +1 -1
modeling_moss_audio_tokenizer.py CHANGED
@@ -941,7 +941,7 @@ class MossAudioTokenizerPatchedPretransform(nn.Module):
941
  x = x.reshape(b, d, -1, h).permute(0, 1, 3, 2).reshape(b, d * h, -1)
942
  # We pad the input waveform to a multiple of `downsample_rate` before applying the encoder.
943
  # Use a ceil division to match that padding and avoid dropping the last (partially padded) frame.
944
- output_lengths = (input_lengths + self.patch_size - 1) // self.patch_size
945
  return x, output_lengths
946
 
947
  def decode(self, x, input_lengths):
 
941
  x = x.reshape(b, d, -1, h).permute(0, 1, 3, 2).reshape(b, d * h, -1)
942
  # We pad the input waveform to a multiple of `downsample_rate` before applying the encoder.
943
  # Use a ceil division to match that padding and avoid dropping the last (partially padded) frame.
944
+ output_lengths = input_lengths // self.patch_size
945
  return x, output_lengths
946
 
947
  def decode(self, x, input_lengths):