mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-10-09 00:10:00 +08:00
Replace 'return_complex=False'
This commit is contained in:
parent
29e2fdc62c
commit
d93b43b6a8
@ -68,7 +68,7 @@ def spectrogram_torch(y, n_fft, sampling_rate, hop_size, win_size, center=False)
|
|||||||
mode="reflect",
|
mode="reflect",
|
||||||
)
|
)
|
||||||
y = y.squeeze(1)
|
y = y.squeeze(1)
|
||||||
spec = torch.stft(
|
spec = torch.view_as_real(torch.stft(
|
||||||
y,
|
y,
|
||||||
n_fft,
|
n_fft,
|
||||||
hop_length=hop_size,
|
hop_length=hop_size,
|
||||||
@ -78,8 +78,8 @@ def spectrogram_torch(y, n_fft, sampling_rate, hop_size, win_size, center=False)
|
|||||||
pad_mode="reflect",
|
pad_mode="reflect",
|
||||||
normalized=False,
|
normalized=False,
|
||||||
onesided=True,
|
onesided=True,
|
||||||
return_complex=False,
|
return_complex=True,
|
||||||
)
|
))
|
||||||
|
|
||||||
spec = torch.sqrt(spec.pow(2).sum(-1) + 1e-6)
|
spec = torch.sqrt(spec.pow(2).sum(-1) + 1e-6)
|
||||||
return spec
|
return spec
|
||||||
@ -132,7 +132,7 @@ def mel_spectrogram_torch(
|
|||||||
)
|
)
|
||||||
y = y.squeeze(1)
|
y = y.squeeze(1)
|
||||||
|
|
||||||
spec = torch.stft(
|
spec = torch.view_as_real(torch.stft(
|
||||||
y,
|
y,
|
||||||
n_fft,
|
n_fft,
|
||||||
hop_length=hop_size,
|
hop_length=hop_size,
|
||||||
@ -142,8 +142,8 @@ def mel_spectrogram_torch(
|
|||||||
pad_mode="reflect",
|
pad_mode="reflect",
|
||||||
normalized=False,
|
normalized=False,
|
||||||
onesided=True,
|
onesided=True,
|
||||||
return_complex=False,
|
return_complex=True,
|
||||||
)
|
))
|
||||||
|
|
||||||
spec = torch.sqrt(spec.pow(2).sum(-1) + 1e-6)
|
spec = torch.sqrt(spec.pow(2).sum(-1) + 1e-6)
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ def spectrogram_torch(y, n_fft, sampling_rate, hop_size, win_size, center=False)
|
|||||||
mode="reflect",
|
mode="reflect",
|
||||||
)
|
)
|
||||||
y = y.squeeze(1)
|
y = y.squeeze(1)
|
||||||
spec = torch.stft(
|
spec = torch.view_as_real(torch.stft(
|
||||||
y,
|
y,
|
||||||
n_fft,
|
n_fft,
|
||||||
hop_length=hop_size,
|
hop_length=hop_size,
|
||||||
@ -33,8 +33,8 @@ def spectrogram_torch(y, n_fft, sampling_rate, hop_size, win_size, center=False)
|
|||||||
pad_mode="reflect",
|
pad_mode="reflect",
|
||||||
normalized=False,
|
normalized=False,
|
||||||
onesided=True,
|
onesided=True,
|
||||||
return_complex=False,
|
return_complex=True,
|
||||||
)
|
))
|
||||||
spec = torch.sqrt(spec.pow(2).sum(-1) + 1e-6)
|
spec = torch.sqrt(spec.pow(2).sum(-1) + 1e-6)
|
||||||
return spec
|
return spec
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user