mirror of
https://github.com/shivammehta25/Matcha-TTS.git
synced 2026-02-05 18:29:19 +08:00
disable global-variable-not-assigned
This commit is contained in:
@@ -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:
|
if torch.max(y) > 1.0:
|
||||||
print("max value is ", torch.max(y))
|
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:
|
if fmax not in mel_basis:
|
||||||
mel = librosa_mel_fn(sampling_rate, n_fft, num_mels, fmin, fmax)
|
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)
|
mel_basis[str(fmax) + "_" + str(y.device)] = torch.from_numpy(mel).float().to(y.device)
|
||||||
|
|||||||
@@ -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:
|
if torch.max(y) > 1.0:
|
||||||
print("max value is ", torch.max(y))
|
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:
|
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 = 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)
|
mel_basis[str(fmax) + "_" + str(y.device)] = torch.from_numpy(mel).float().to(y.device)
|
||||||
|
|||||||
Reference in New Issue
Block a user