Li-Ruixiao fdugyt commited on
Commit
78a70f2
·
1 Parent(s): 66562e3

Update modeling_moss_audio_tokenizer.py (#3)

Browse files

- Update modeling_moss_audio_tokenizer.py (e4e83246b8ceef986cb57abc82ece6ddc549d226)


Co-authored-by: yitian gong <fdugyt@users.noreply.huggingface.co>

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):