mirror of https://github.com/coqui-ai/TTS.git
Merge pull request #9 from eginhard/disable-wavegrad-test
test(vocoder): disable wavegrad training test in CI
This commit is contained in:
commit
ec2346099d
|
@ -1,43 +1,54 @@
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import unittest
|
||||||
|
|
||||||
from tests import get_device_id, get_tests_output_path, run_cli
|
from tests import get_device_id, get_tests_output_path, run_cli
|
||||||
from TTS.vocoder.configs import WavegradConfig
|
from TTS.vocoder.configs import WavegradConfig
|
||||||
|
|
||||||
config_path = os.path.join(get_tests_output_path(), "test_vocoder_config.json")
|
|
||||||
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
|
||||||
|
|
||||||
config = WavegradConfig(
|
class WavegradTrainingTest(unittest.TestCase):
|
||||||
batch_size=8,
|
# TODO: Reactivate after improving CI run times
|
||||||
eval_batch_size=8,
|
# This test currently takes ~2h on CI (15min/step vs 8sec/step locally)
|
||||||
num_loader_workers=0,
|
if os.getenv("GITHUB_ACTIONS") == "true":
|
||||||
num_eval_loader_workers=0,
|
__test__ = False
|
||||||
run_eval=True,
|
|
||||||
test_delay_epochs=-1,
|
|
||||||
epochs=1,
|
|
||||||
seq_len=8192,
|
|
||||||
eval_split_size=1,
|
|
||||||
print_step=1,
|
|
||||||
print_eval=True,
|
|
||||||
data_path="tests/data/ljspeech",
|
|
||||||
output_path=output_path,
|
|
||||||
test_noise_schedule={"min_val": 1e-6, "max_val": 1e-2, "num_steps": 2},
|
|
||||||
)
|
|
||||||
config.audio.do_trim_silence = True
|
|
||||||
config.audio.trim_db = 60
|
|
||||||
config.save_json(config_path)
|
|
||||||
|
|
||||||
# train the model for one epoch
|
def test_train(self): # pylint: disable=no-self-use
|
||||||
command_train = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' python TTS/bin/train_vocoder.py --config_path {config_path} "
|
config_path = os.path.join(get_tests_output_path(), "test_vocoder_config.json")
|
||||||
run_cli(command_train)
|
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
||||||
|
|
||||||
# Find latest folder
|
config = WavegradConfig(
|
||||||
continue_path = max(glob.glob(os.path.join(output_path, "*/")), key=os.path.getmtime)
|
batch_size=8,
|
||||||
|
eval_batch_size=8,
|
||||||
|
num_loader_workers=0,
|
||||||
|
num_eval_loader_workers=0,
|
||||||
|
run_eval=True,
|
||||||
|
test_delay_epochs=-1,
|
||||||
|
epochs=1,
|
||||||
|
seq_len=8192,
|
||||||
|
eval_split_size=1,
|
||||||
|
print_step=1,
|
||||||
|
print_eval=True,
|
||||||
|
data_path="tests/data/ljspeech",
|
||||||
|
output_path=output_path,
|
||||||
|
test_noise_schedule={"min_val": 1e-6, "max_val": 1e-2, "num_steps": 2},
|
||||||
|
)
|
||||||
|
config.audio.do_trim_silence = True
|
||||||
|
config.audio.trim_db = 60
|
||||||
|
config.save_json(config_path)
|
||||||
|
|
||||||
# restore the model and continue training for one more epoch
|
# train the model for one epoch
|
||||||
command_train = (
|
command_train = (
|
||||||
f"CUDA_VISIBLE_DEVICES='{get_device_id()}' python TTS/bin/train_vocoder.py --continue_path {continue_path} "
|
f"CUDA_VISIBLE_DEVICES='{get_device_id()}' python TTS/bin/train_vocoder.py --config_path {config_path} "
|
||||||
)
|
)
|
||||||
run_cli(command_train)
|
run_cli(command_train)
|
||||||
shutil.rmtree(continue_path)
|
|
||||||
|
# Find latest folder
|
||||||
|
continue_path = max(glob.glob(os.path.join(output_path, "*/")), key=os.path.getmtime)
|
||||||
|
|
||||||
|
# restore the model and continue training for one more epoch
|
||||||
|
command_train = (
|
||||||
|
f"CUDA_VISIBLE_DEVICES='{get_device_id()}' python TTS/bin/train_vocoder.py --continue_path {continue_path} "
|
||||||
|
)
|
||||||
|
run_cli(command_train)
|
||||||
|
shutil.rmtree(continue_path)
|
||||||
|
|
Loading…
Reference in New Issue