Skip to content

Commit

Permalink
Change the VITS upsampling interpolation trick to linear
Browse files Browse the repository at this point in the history
  • Loading branch information
Edresson committed May 9, 2022
1 parent 9014a99 commit f8bafdf
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions TTS/tts/models/vits.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down

0 comments on commit f8bafdf

Please sign in to comment.