mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
refine decoding process, merge flow and vocoder
This commit is contained in:
parent
c2c1b66674
commit
04c2d487ed
@ -615,7 +615,11 @@ class HiFTGenerator(nn.Module):
|
|||||||
real = magnitude * torch.cos(phase)
|
real = magnitude * torch.cos(phase)
|
||||||
img = magnitude * torch.sin(phase)
|
img = magnitude * torch.sin(phase)
|
||||||
inverse_transform = torch.istft(
|
inverse_transform = torch.istft(
|
||||||
torch.cat([real.unsqueeze(-1), img.unsqueeze(-1)], dim=-1),
|
# torch.cat([real.unsqueeze(-1), img.unsqueeze(-1)], dim=-1),
|
||||||
self.istft_params["n_fft"], self.istft_params["hop_len"], self.istft_params["n_fft"], window=self.stft_window)
|
torch.complex(real, img),
|
||||||
|
self.istft_params["n_fft"], self.istft_params["hop_len"],
|
||||||
|
self.istft_params["n_fft"], window=self.stft_window,
|
||||||
|
return_complex=False
|
||||||
|
)
|
||||||
|
|
||||||
return inverse_transform.unsqueeze(-2) # unsqueeze to stay consistent with conv_transpose1d implementation
|
return inverse_transform.unsqueeze(-2) # unsqueeze to stay consistent with conv_transpose1d implementation
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user