mirror of
https://github.com/wassname/TTS.git
synced 2026-09-12 12:11:47 +08:00
bug fixes
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import unittest
|
||||
|
||||
from utils.text import phonemes
|
||||
from collections import Counter
|
||||
|
||||
class SymbolsTest(unittest.TestCase):
|
||||
def test_uniqueness(self):
|
||||
assert sorted(phonemes) == sorted(list(set(phonemes)))
|
||||
assert sorted(phonemes) == sorted(list(set(phonemes))), " {} vs {} ".format(len(phonemes), len(set(phonemes)))
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import os
|
||||
import unittest
|
||||
import shutil
|
||||
import torch
|
||||
|
||||
from torch.utils.data import DataLoader
|
||||
from utils.generic_utils import load_config
|
||||
@@ -130,10 +131,11 @@ class TestTTSDataset(unittest.TestCase):
|
||||
# check mel_spec consistency
|
||||
wav = self.ap.load_wav(item_idx[0])
|
||||
mel = self.ap.melspectrogram(wav)
|
||||
mel_dl = mel_input[0].cpu().numpy()
|
||||
assert (abs(mel.T).astype("float32")
|
||||
mel = torch.FloatTensor(mel)
|
||||
mel_dl = mel_input[0]
|
||||
assert (abs(mel.T)
|
||||
- abs(mel_dl[:-1])
|
||||
).sum() == 0
|
||||
).sum() == 0, (abs(mel.T)- abs(mel_dl[:-1])).sum()
|
||||
|
||||
# check mel-spec correctness
|
||||
mel_spec = mel_input[0].cpu().numpy()
|
||||
|
||||
Reference in New Issue
Block a user