Ensure decoding produces expected output.
(self)
| 105 | self.assertGreater(encoded.shape[-1], 0) |
| 106 | |
| 107 | def test_decoding(self): |
| 108 | """Ensure decoding produces expected output.""" |
| 109 | pcm_chunk_size = int(self.mimi.sample_rate / self.mimi.frame_rate) |
| 110 | sample_pcm = torch.tensor(self.sample_pcm, device=self.device)[None] |
| 111 | chunk = sample_pcm[..., 0:pcm_chunk_size] |
| 112 | encoded = self.mimi.encode(chunk) |
| 113 | decoded = self.mimi.decode(encoded) |
| 114 | self.assertIsInstance(decoded, torch.Tensor) |
| 115 | |
| 116 | def test_streaming_encoding_decoding(self): |
| 117 | """Test streaming encoding and decoding consistency.""" |