From f8bafdf95e73f0831b10b75714b718168210028e Mon Sep 17 00:00:00 2001 From: Edresson Casanova Date: Mon, 9 May 2022 10:14:24 -0300 Subject: [PATCH] Change the VITS upsampling interpolation trick to linear --- TTS/tts/models/vits.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/TTS/tts/models/vits.py b/TTS/tts/models/vits.py index af995bdaf0..af3d61f2c1 100644 --- a/TTS/tts/models/vits.py +++ b/TTS/tts/models/vits.py @@ -890,9 +890,7 @@ def upsampling_z(self, z, slice_ids=None, y_lengths=None, y_mask=None): spec_segment_size = spec_segment_size * int(self.interpolate_factor) # interpolate z if needed if self.args.interpolate_z: - z = torch.nn.functional.interpolate( - z.unsqueeze(0), scale_factor=[1, self.interpolate_factor], mode="nearest" - ).squeeze(0) + z = torch.nn.functional.interpolate(z, scale_factor=[self.interpolate_factor], mode="linear").squeeze(0) # recompute the mask if needed if y_lengths is not None and y_mask is not None: y_mask = (