Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions tests/model_executor/models/test_fish_speech_regressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@


class _FakeCodec:
def decode(self, codes_bqf: torch.Tensor, feature_lengths: torch.Tensor):
del codes_bqf, feature_lengths
wav = torch.arange(100, dtype=torch.float32).view(1, 1, 100)
audio_lengths = torch.tensor([100], dtype=torch.long)
return wav, audio_lengths
def from_indices(self, codes_bqf: torch.Tensor):
del codes_bqf
return torch.arange(100, dtype=torch.float32).view(1, 1, 100)


class _FakeTokenizer:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,11 @@ def forward(
codes_bqf[i, :, :frame_count] = codes_qf

with torch.amp.autocast("cuda", enabled=False):
wav_batch, audio_lengths = self._codec.decode(codes_bqf, feature_lengths)
wav_batch = self._codec.from_indices(codes_bqf)
audio_lengths = torch.clamp(
feature_lengths * self._hop_length,
max=wav_batch.shape[-1],
)

audios: list[torch.Tensor] = [empty] * num_req
srs = [sr_tensor] * num_req
Expand Down
Loading