mirror of
https://github.com/wassname/TTS.git
synced 2026-09-10 11:50:20 +08:00
fix Lint checks
This commit is contained in:
@@ -6,6 +6,7 @@ from tests import get_tests_input_path
|
||||
from TTS.speaker_encoder.losses import AngleProtoLoss, GE2ELoss, SoftmaxAngleProtoLoss
|
||||
from TTS.speaker_encoder.models.lstm import LSTMSpeakerEncoder
|
||||
from TTS.speaker_encoder.models.resnet import ResNetSpeakerEncoder
|
||||
|
||||
file_path = get_tests_input_path()
|
||||
|
||||
|
||||
@@ -39,6 +40,7 @@ class LSTMSpeakerEncoderTests(unittest.TestCase):
|
||||
assert output.shape[1] == 256
|
||||
assert len(output.shape) == 2
|
||||
|
||||
|
||||
class ResNetSpeakerEncoderTests(unittest.TestCase):
|
||||
# pylint: disable=R0201
|
||||
def test_in_out(self):
|
||||
@@ -65,6 +67,7 @@ class ResNetSpeakerEncoderTests(unittest.TestCase):
|
||||
assert output.shape[1] == 256
|
||||
assert len(output.shape) == 2
|
||||
|
||||
|
||||
class GE2ELossTests(unittest.TestCase):
|
||||
# pylint: disable=R0201
|
||||
def test_in_out(self):
|
||||
@@ -92,6 +95,7 @@ class GE2ELossTests(unittest.TestCase):
|
||||
output = loss.forward(dummy_input)
|
||||
assert output.item() < 0.005
|
||||
|
||||
|
||||
class AngleProtoLossTests(unittest.TestCase):
|
||||
# pylint: disable=R0201
|
||||
def test_in_out(self):
|
||||
@@ -121,6 +125,7 @@ class AngleProtoLossTests(unittest.TestCase):
|
||||
output = loss.forward(dummy_input)
|
||||
assert output.item() < 0.005
|
||||
|
||||
|
||||
class SoftmaxAngleProtoLossTests(unittest.TestCase):
|
||||
# pylint: disable=R0201
|
||||
def test_in_out(self):
|
||||
|
||||
@@ -46,7 +46,7 @@ run_cli(command_train)
|
||||
shutil.rmtree(continue_path)
|
||||
|
||||
# test resnet speaker encoder
|
||||
config.model_params['model_name'] = "resnet"
|
||||
config.model_params["model_name"] = "resnet"
|
||||
config.save_json(config_path)
|
||||
|
||||
# train the model for one epoch
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import unittest
|
||||
|
||||
from TTS.tts.utils.text.japanese.phonemizer import japanese_text_to_phonemes
|
||||
|
||||
_TEST_CASES = """
|
||||
どちらに行きますか?/dochiraniikimasuka?
|
||||
今日は温泉に、行きます。/kyo:waoNseNni,ikimasu.
|
||||
「A」から「Z」までです。/AkaraZmadedesu.
|
||||
そうですね!/so:desune!
|
||||
クジラは哺乳類です。/kujirawahonyu:ruidesu.
|
||||
ヴィディオを見ます。/bidioomimasu.
|
||||
ky o: w a o N s e N n i , i k i m a s u ./kyo:waoNseNni,ikimasu.
|
||||
"""
|
||||
|
||||
|
||||
class TestText(unittest.TestCase):
|
||||
def test_japanese_text_to_phonemes(self):
|
||||
for line in _TEST_CASES.strip().split("\n"):
|
||||
text, phone = line.split("/")
|
||||
self.assertEqual(japanese_text_to_phonemes(text), phone)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -17,7 +17,7 @@ config = GlowTTSConfig(
|
||||
text_cleaner="english_cleaners",
|
||||
use_phonemes=True,
|
||||
phoneme_language="zh-CN",
|
||||
phoneme_cache_path='tests/data/ljspeech/phoneme_cache/',
|
||||
phoneme_cache_path="tests/data/ljspeech/phoneme_cache/",
|
||||
run_eval=True,
|
||||
test_delay_epochs=-1,
|
||||
epochs=1,
|
||||
|
||||
@@ -17,7 +17,7 @@ config = SpeedySpeechConfig(
|
||||
text_cleaner="english_cleaners",
|
||||
use_phonemes=True,
|
||||
phoneme_language="zh-CN",
|
||||
phoneme_cache_path='tests/data/ljspeech/phoneme_cache/',
|
||||
phoneme_cache_path="tests/data/ljspeech/phoneme_cache/",
|
||||
run_eval=True,
|
||||
test_delay_epochs=-1,
|
||||
epochs=1,
|
||||
|
||||
@@ -20,6 +20,7 @@ config = FullbandMelganConfig(
|
||||
eval_split_size=1,
|
||||
print_step=1,
|
||||
print_eval=True,
|
||||
discriminator_model_params={"base_channels": 16, "max_channels": 256, "downsample_factors": [4, 4, 4]},
|
||||
data_path="tests/data/ljspeech",
|
||||
output_path=output_path,
|
||||
)
|
||||
|
||||
@@ -19,6 +19,7 @@ config = MelganConfig(
|
||||
seq_len=2048,
|
||||
eval_split_size=1,
|
||||
print_step=1,
|
||||
discriminator_model_params={"base_channels": 16, "max_channels": 256, "downsample_factors": [4, 4, 4]},
|
||||
print_eval=True,
|
||||
data_path="tests/data/ljspeech",
|
||||
output_path=output_path,
|
||||
|
||||
Reference in New Issue
Block a user