diff --git a/matcha/hifigan/meldataset.py b/matcha/hifigan/meldataset.py index 8b43ea7..d1b3a90 100644 --- a/matcha/hifigan/meldataset.py +++ b/matcha/hifigan/meldataset.py @@ -55,7 +55,7 @@ def mel_spectrogram(y, n_fft, num_mels, sampling_rate, hop_size, win_size, fmin, if torch.max(y) > 1.0: print("max value is ", torch.max(y)) - global mel_basis, hann_window # pylint: disable=global-statement + global mel_basis, hann_window # pylint: disable=global-statement,global-variable-not-assigned if fmax not in mel_basis: mel = librosa_mel_fn(sampling_rate, n_fft, num_mels, fmin, fmax) mel_basis[str(fmax) + "_" + str(y.device)] = torch.from_numpy(mel).float().to(y.device) diff --git a/matcha/utils/audio.py b/matcha/utils/audio.py index 0bcd74d..d257f0d 100644 --- a/matcha/utils/audio.py +++ b/matcha/utils/audio.py @@ -48,7 +48,7 @@ def mel_spectrogram(y, n_fft, num_mels, sampling_rate, hop_size, win_size, fmin, if torch.max(y) > 1.0: print("max value is ", torch.max(y)) - global mel_basis, hann_window # pylint: disable=global-statement + global mel_basis, hann_window # pylint: disable=global-statement,global-variable-not-assigned if f"{str(fmax)}_{str(y.device)}" not in mel_basis: mel = librosa_mel_fn(sr=sampling_rate, n_fft=n_fft, n_mels=num_mels, fmin=fmin, fmax=fmax) mel_basis[str(fmax) + "_" + str(y.device)] = torch.from_numpy(mel).float().to(y.device)