Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

istft #109

Open
wkx-anything opened this issue Jan 17, 2024 · 4 comments
Open

istft #109

wkx-anything opened this issue Jan 17, 2024 · 4 comments

Comments

@wkx-anything
Copy link

File ~/anaconda3/envs/Chat_GLM/lib/python3.10/site-packages/wavmark/models/my_model.py:27, in Model.istft(self, signal_wmd_fft)
23 def istft(self, signal_wmd_fft):
25 window = torch.hann_window(self.n_fft).to(signal_wmd_fft.device)
---> 27 return torch.istft(signal_wmd_fft, n_fft=self.n_fft, hop_length=self.hop_length, window=window,
28 return_complex=False)

RuntimeError: istft requires a complex-valued input tensor matching the output from stft with return_complex=True.

torch version 2.0.1
cuda 11.8

@wkx-anything
Copy link
Author

wkx-anything commented Jan 17, 2024

how do I solve this?

@patriotyk
Copy link

You have to downgrade torch, but I can't say to which version.

@ricperry
Copy link

ricperry commented Jan 31, 2024

If you don't want or can't downgrade torch, you can edit venv/lib/python3.10/site-packages/wavmark/models/my_model.py. Change the def istft(): function to read as follows:

def istft(self, signal_wmd_fft):
    window = torch.hann_window(self.n_fft).to(signal_wmd_fft.device)
    signal_wmd_fft = torch.view_as_complex(signal_wmd_fft)
    return torch.istft(signal_wmd_fft, n_fft=self.n_fft, hop_length=self.hop_length, window=window,
                       return_complex=False)

Note the addition of the line "signal..."

@lazzarello
Copy link

The dependency in question is wavmark and must be version 0.0.3 to use OpenVoice with Torch 2.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants