Update data_utils.py
This commit is contained in:
@@ -93,12 +93,6 @@ class TextAudioSpeakerLoader(torch.utils.data.Dataset):
|
|||||||
spec = torch.load(spec_filename)
|
spec = torch.load(spec_filename)
|
||||||
except:
|
except:
|
||||||
if self.use_mel_spec_posterior:
|
if self.use_mel_spec_posterior:
|
||||||
# if os.path.exists(filename.replace(".wav", ".spec.pt")):
|
|
||||||
# # spec, n_fft, num_mels, sampling_rate, fmin, fmax
|
|
||||||
# spec = spec_to_mel_torch(
|
|
||||||
# torch.load(filename.replace(".wav", ".spec.pt")),
|
|
||||||
# self.filter_length, self.n_mel_channels, self.sampling_rate,
|
|
||||||
# self.hparams.mel_fmin, self.hparams.mel_fmax)
|
|
||||||
spec = mel_spectrogram_torch(audio_norm, self.filter_length,
|
spec = mel_spectrogram_torch(audio_norm, self.filter_length,
|
||||||
self.n_mel_channels, self.sampling_rate, self.hop_length,
|
self.n_mel_channels, self.sampling_rate, self.hop_length,
|
||||||
self.win_length, self.hparams.mel_fmin, self.hparams.mel_fmax, center=False)
|
self.win_length, self.hparams.mel_fmin, self.hparams.mel_fmax, center=False)
|
||||||
@@ -111,7 +105,6 @@ class TextAudioSpeakerLoader(torch.utils.data.Dataset):
|
|||||||
return spec, audio_norm
|
return spec, audio_norm
|
||||||
|
|
||||||
def get_text(self, text, word2ph, phone, tone, language_str, wav_path):
|
def get_text(self, text, word2ph, phone, tone, language_str, wav_path):
|
||||||
# print(text, word2ph,phone, tone, language_str)
|
|
||||||
pold = phone
|
pold = phone
|
||||||
w2pho = [i for i in word2ph]
|
w2pho = [i for i in word2ph]
|
||||||
word2ph = [i for i in word2ph]
|
word2ph = [i for i in word2ph]
|
||||||
@@ -136,7 +129,6 @@ class TextAudioSpeakerLoader(torch.utils.data.Dataset):
|
|||||||
except:
|
except:
|
||||||
bert = get_bert(text, word2ph, language_str)
|
bert = get_bert(text, word2ph, language_str)
|
||||||
torch.save(bert, bert_path)
|
torch.save(bert, bert_path)
|
||||||
#print(bert.shape[-1], bert_path, text, pold)
|
|
||||||
assert bert.shape[-1] == len(phone)
|
assert bert.shape[-1] == len(phone)
|
||||||
|
|
||||||
assert bert.shape[-1] == len(phone), (
|
assert bert.shape[-1] == len(phone), (
|
||||||
|
|||||||
Reference in New Issue
Block a user