From c52385afdb79cf9994156d5d0a9883e7edb858c5 Mon Sep 17 00:00:00 2001 From: "Codename;0" <139770129+codename0og@users.noreply.github.com> Date: Sat, 21 Dec 2024 16:53:51 +0100 Subject: [PATCH] correction --- rvc/train/mel_processing.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rvc/train/mel_processing.py b/rvc/train/mel_processing.py index 5a886fa..e6186a3 100644 --- a/rvc/train/mel_processing.py +++ b/rvc/train/mel_processing.py @@ -184,12 +184,12 @@ def mel_spectrogram( mel_dtype_device = str(n_mels) + "_" + dtype_device # caching hann window if win_dtype_device not in self.hann_window: - self.hann_window[win_dtype_device] = torch.hann_window(window_length, device=wav.device, dtype=wav.dtype) - + self.hann_window[win_dtype_device] = torch.hann_window(window_length, device=wav.device, dtype=torch.float32) + wav = wav.squeeze(1) # -> torch(B, T) stft = torch.stft( - wav, + wav.float(), n_fft=window_length, hop_length=hop_length, window=self.hann_window[win_dtype_device], @@ -208,7 +208,7 @@ def mel_spectrogram( fmin=0, fmax=None, ) - ).to(device=wav.device, dtype=wav.dtype) + ).to(device=wav.device, dtype=torch.float32) mel_spectrogram = torch.matmul( self.mel_banks[mel_dtype_device], magnitude