Skip to content

Commit

Permalink
test(find_unique_phonemes): remove duplicate test
Browse files Browse the repository at this point in the history
  • Loading branch information
eginhard committed Dec 13, 2024
1 parent a02e0f9 commit 1837af5
Showing 1 changed file with 24 additions and 55 deletions.
79 changes: 24 additions & 55 deletions tests/aux_tests/test_find_unique_phonemes.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import os
import unittest

import torch

from tests import get_tests_output_path, run_cli
from tests import run_cli
from TTS.config.shared_configs import BaseDatasetConfig
from TTS.tts.configs.vits_config import VitsConfig

torch.manual_seed(1)

config_path = os.path.join(get_tests_output_path(), "test_model_config.json")

dataset_config_en = BaseDatasetConfig(
formatter="ljspeech",
meta_file_train="metadata.csv",
Expand All @@ -30,52 +25,26 @@
"""


# pylint: disable=protected-access
class TestFindUniquePhonemes(unittest.TestCase):
@staticmethod
def test_espeak_phonemes():
# prepare the config
config = VitsConfig(
batch_size=2,
eval_batch_size=2,
num_loader_workers=0,
num_eval_loader_workers=0,
text_cleaner="english_cleaners",
use_phonemes=True,
phoneme_language="en-us",
phoneme_cache_path="tests/data/ljspeech/phoneme_cache/",
run_eval=True,
test_delay_epochs=-1,
epochs=1,
print_step=1,
print_eval=True,
datasets=[dataset_config_en],
)
config.save_json(config_path)

# run test
run_cli(f'CUDA_VISIBLE_DEVICES="" python TTS/bin/find_unique_phonemes.py --config_path "{config_path}"')

@staticmethod
def test_no_espeak_phonemes():
# prepare the config
config = VitsConfig(
batch_size=2,
eval_batch_size=2,
num_loader_workers=0,
num_eval_loader_workers=0,
text_cleaner="english_cleaners",
use_phonemes=True,
phoneme_language="en-us",
phoneme_cache_path="tests/data/ljspeech/phoneme_cache/",
run_eval=True,
test_delay_epochs=-1,
epochs=1,
print_step=1,
print_eval=True,
datasets=[dataset_config_en],
)
config.save_json(config_path)

# run test
run_cli(f'CUDA_VISIBLE_DEVICES="" python TTS/bin/find_unique_phonemes.py --config_path "{config_path}"')
def test_find_phonemes(tmp_path):
# prepare the config
config_path = tmp_path / "test_model_config.json"
config = VitsConfig(
batch_size=2,
eval_batch_size=2,
num_loader_workers=0,
num_eval_loader_workers=0,
text_cleaner="english_cleaners",
use_phonemes=True,
phoneme_language="en-us",
phoneme_cache_path="tests/data/ljspeech/phoneme_cache/",
run_eval=True,
test_delay_epochs=-1,
epochs=1,
print_step=1,
print_eval=True,
datasets=[dataset_config_en],
)
config.save_json(config_path)

# run test
run_cli(f'CUDA_VISIBLE_DEVICES="" python TTS/bin/find_unique_phonemes.py --config_path "{config_path}"')

0 comments on commit 1837af5

Please sign in to comment.