fix: 卸载音色省显存

顺便将所有print换成了统一的logger
This commit is contained in:
源文雨
2023-09-01 15:18:08 +08:00
parent 8d5a77dbe9
commit 04a33b9709
23 changed files with 189 additions and 106 deletions

View File

@@ -1,6 +1,8 @@
import torch
import torch.utils.data
from librosa.filters import mel as librosa_mel_fn
import logging
logger = logging.getLogger(__name__)
MAX_WAV_VALUE = 32768.0
@@ -51,9 +53,9 @@ def spectrogram_torch(y, n_fft, sampling_rate, hop_size, win_size, center=False)
"""
# Validation
if torch.min(y) < -1.07:
print("spectrogram_torch min value is ", torch.min(y))
logger.debug("min value is ", torch.min(y))
if torch.max(y) > 1.07:
print("spectrogram_torch max value is ", torch.max(y))
logger.debug("max value is ", torch.max(y))
# Window - Cache if needed
global hann_window