From 1837af52c01bb948b65d11077299c26bb88c2d7f Mon Sep 17 00:00:00 2001 From: Enno Hermann Date: Fri, 13 Dec 2024 10:30:16 +0100 Subject: [PATCH] test(find_unique_phonemes): remove duplicate test --- tests/aux_tests/test_find_unique_phonemes.py | 79 ++++++-------------- 1 file changed, 24 insertions(+), 55 deletions(-) diff --git a/tests/aux_tests/test_find_unique_phonemes.py b/tests/aux_tests/test_find_unique_phonemes.py index 018679f573..a04c12af59 100644 --- a/tests/aux_tests/test_find_unique_phonemes.py +++ b/tests/aux_tests/test_find_unique_phonemes.py @@ -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", @@ -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}"')