mirror of https://github.com/coqui-ai/TTS.git
Test config overides by args and tokenizer
This commit is contained in:
parent
d00327d608
commit
8c7af4764d
|
@ -1,6 +1,7 @@
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import json
|
||||||
|
|
||||||
from trainer import get_last_checkpoint
|
from trainer import get_last_checkpoint
|
||||||
|
|
||||||
|
@ -42,7 +43,7 @@ command_train = (
|
||||||
"--coqpit.datasets.0.meta_file_train metadata.csv "
|
"--coqpit.datasets.0.meta_file_train metadata.csv "
|
||||||
"--coqpit.datasets.0.meta_file_val metadata.csv "
|
"--coqpit.datasets.0.meta_file_val metadata.csv "
|
||||||
"--coqpit.datasets.0.path tests/data/ljspeech "
|
"--coqpit.datasets.0.path tests/data/ljspeech "
|
||||||
"--coqpit.test_delay_epochs -1"
|
"--coqpit.test_delay_epochs 0 "
|
||||||
)
|
)
|
||||||
run_cli(command_train)
|
run_cli(command_train)
|
||||||
|
|
||||||
|
@ -54,6 +55,14 @@ continue_config_path = os.path.join(continue_path, "config.json")
|
||||||
continue_restore_path, _ = get_last_checkpoint(continue_path)
|
continue_restore_path, _ = get_last_checkpoint(continue_path)
|
||||||
out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
||||||
|
|
||||||
|
# Check integrity of the config
|
||||||
|
with open(continue_config_path, "r") as f:
|
||||||
|
config_loaded = json.load(f)
|
||||||
|
assert config_loaded['characters'] != None
|
||||||
|
assert config_loaded['output_path'] in continue_path
|
||||||
|
assert config_loaded['test_delay_epochs'] == 0
|
||||||
|
|
||||||
|
# Load the model and run inference
|
||||||
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
||||||
run_cli(inference_command)
|
run_cli(inference_command)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import json
|
||||||
|
|
||||||
from trainer import get_last_checkpoint
|
from trainer import get_last_checkpoint
|
||||||
|
|
||||||
|
@ -74,6 +75,14 @@ out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
||||||
speaker_id = "ljspeech-1"
|
speaker_id = "ljspeech-1"
|
||||||
continue_speakers_path = os.path.join(continue_path, "speakers.json")
|
continue_speakers_path = os.path.join(continue_path, "speakers.json")
|
||||||
|
|
||||||
|
# Check integrity of the config
|
||||||
|
with open(continue_config_path, "r") as f:
|
||||||
|
config_loaded = json.load(f)
|
||||||
|
assert config_loaded['characters'] != None
|
||||||
|
assert config_loaded['output_path'] in continue_path
|
||||||
|
assert config_loaded['test_delay_epochs'] == 0
|
||||||
|
|
||||||
|
# Load the model and run inference
|
||||||
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --speaker_idx {speaker_id} --speakers_file_path {continue_speakers_path} --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --speaker_idx {speaker_id} --speakers_file_path {continue_speakers_path} --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
||||||
run_cli(inference_command)
|
run_cli(inference_command)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import json
|
||||||
|
|
||||||
from trainer import get_last_checkpoint
|
from trainer import get_last_checkpoint
|
||||||
|
|
||||||
|
@ -73,6 +74,14 @@ continue_config_path = os.path.join(continue_path, "config.json")
|
||||||
continue_restore_path, _ = get_last_checkpoint(continue_path)
|
continue_restore_path, _ = get_last_checkpoint(continue_path)
|
||||||
out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
||||||
|
|
||||||
|
# Check integrity of the config
|
||||||
|
with open(continue_config_path, "r") as f:
|
||||||
|
config_loaded = json.load(f)
|
||||||
|
assert config_loaded['characters'] != None
|
||||||
|
assert config_loaded['output_path'] in continue_path
|
||||||
|
assert config_loaded['test_delay_epochs'] == 0
|
||||||
|
|
||||||
|
# Load the model and run inference
|
||||||
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
||||||
run_cli(inference_command)
|
run_cli(inference_command)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import json
|
||||||
|
|
||||||
from trainer import get_last_checkpoint
|
from trainer import get_last_checkpoint
|
||||||
|
|
||||||
|
@ -61,6 +62,14 @@ out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
||||||
speaker_id = "ljspeech-1"
|
speaker_id = "ljspeech-1"
|
||||||
continue_speakers_path = config.d_vector_file
|
continue_speakers_path = config.d_vector_file
|
||||||
|
|
||||||
|
# Check integrity of the config
|
||||||
|
with open(continue_config_path, "r") as f:
|
||||||
|
config_loaded = json.load(f)
|
||||||
|
assert config_loaded['characters'] != None
|
||||||
|
assert config_loaded['output_path'] in continue_path
|
||||||
|
assert config_loaded['test_delay_epochs'] == 0
|
||||||
|
|
||||||
|
# Load the model and run inference
|
||||||
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --speaker_idx {speaker_id} --speakers_file_path {continue_speakers_path} --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --speaker_idx {speaker_id} --speakers_file_path {continue_speakers_path} --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
||||||
run_cli(inference_command)
|
run_cli(inference_command)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import json
|
||||||
|
|
||||||
from trainer import get_last_checkpoint
|
from trainer import get_last_checkpoint
|
||||||
|
|
||||||
|
@ -58,6 +59,14 @@ out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
||||||
speaker_id = "ljspeech-1"
|
speaker_id = "ljspeech-1"
|
||||||
continue_speakers_path = os.path.join(continue_path, "speakers.json")
|
continue_speakers_path = os.path.join(continue_path, "speakers.json")
|
||||||
|
|
||||||
|
# Check integrity of the config
|
||||||
|
with open(continue_config_path, "r") as f:
|
||||||
|
config_loaded = json.load(f)
|
||||||
|
assert config_loaded['characters'] != None
|
||||||
|
assert config_loaded['output_path'] in continue_path
|
||||||
|
assert config_loaded['test_delay_epochs'] == 0
|
||||||
|
|
||||||
|
# Load the model and run inference
|
||||||
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --speaker_idx {speaker_id} --speakers_file_path {continue_speakers_path} --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --speaker_idx {speaker_id} --speakers_file_path {continue_speakers_path} --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
||||||
run_cli(inference_command)
|
run_cli(inference_command)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import json
|
||||||
|
|
||||||
from trainer import get_last_checkpoint
|
from trainer import get_last_checkpoint
|
||||||
|
|
||||||
|
@ -55,6 +56,14 @@ continue_config_path = os.path.join(continue_path, "config.json")
|
||||||
continue_restore_path, _ = get_last_checkpoint(continue_path)
|
continue_restore_path, _ = get_last_checkpoint(continue_path)
|
||||||
out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
||||||
|
|
||||||
|
# Check integrity of the config
|
||||||
|
with open(continue_config_path, "r") as f:
|
||||||
|
config_loaded = json.load(f)
|
||||||
|
assert config_loaded['characters'] != None
|
||||||
|
assert config_loaded['output_path'] in continue_path
|
||||||
|
assert config_loaded['test_delay_epochs'] == 0
|
||||||
|
|
||||||
|
# Load the model and run inference
|
||||||
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
||||||
run_cli(inference_command)
|
run_cli(inference_command)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import json
|
||||||
|
|
||||||
from trainer import get_last_checkpoint
|
from trainer import get_last_checkpoint
|
||||||
|
|
||||||
|
@ -54,6 +55,14 @@ continue_config_path = os.path.join(continue_path, "config.json")
|
||||||
continue_restore_path, _ = get_last_checkpoint(continue_path)
|
continue_restore_path, _ = get_last_checkpoint(continue_path)
|
||||||
out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
||||||
|
|
||||||
|
# Check integrity of the config
|
||||||
|
with open(continue_config_path, "r") as f:
|
||||||
|
config_loaded = json.load(f)
|
||||||
|
assert config_loaded['characters'] != None
|
||||||
|
assert config_loaded['output_path'] in continue_path
|
||||||
|
assert config_loaded['test_delay_epochs'] == 0
|
||||||
|
|
||||||
|
# Load the model and run inference
|
||||||
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example for it.' --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example for it.' --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
||||||
run_cli(inference_command)
|
run_cli(inference_command)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import json
|
||||||
|
|
||||||
from trainer import get_last_checkpoint
|
from trainer import get_last_checkpoint
|
||||||
|
|
||||||
|
@ -61,6 +62,14 @@ out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
||||||
speaker_id = "ljspeech-1"
|
speaker_id = "ljspeech-1"
|
||||||
continue_speakers_path = config.d_vector_file
|
continue_speakers_path = config.d_vector_file
|
||||||
|
|
||||||
|
# Check integrity of the config
|
||||||
|
with open(continue_config_path, "r") as f:
|
||||||
|
config_loaded = json.load(f)
|
||||||
|
assert config_loaded['characters'] != None
|
||||||
|
assert config_loaded['output_path'] in continue_path
|
||||||
|
assert config_loaded['test_delay_epochs'] == 0
|
||||||
|
|
||||||
|
# Load the model and run inference
|
||||||
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --speaker_idx {speaker_id} --speakers_file_path {continue_speakers_path} --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --speaker_idx {speaker_id} --speakers_file_path {continue_speakers_path} --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
||||||
run_cli(inference_command)
|
run_cli(inference_command)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import json
|
||||||
|
|
||||||
from trainer import get_last_checkpoint
|
from trainer import get_last_checkpoint
|
||||||
|
|
||||||
|
@ -59,6 +60,14 @@ out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
||||||
speaker_id = "ljspeech-1"
|
speaker_id = "ljspeech-1"
|
||||||
continue_speakers_path = os.path.join(continue_path, "speakers.json")
|
continue_speakers_path = os.path.join(continue_path, "speakers.json")
|
||||||
|
|
||||||
|
# Check integrity of the config
|
||||||
|
with open(continue_config_path, "r") as f:
|
||||||
|
config_loaded = json.load(f)
|
||||||
|
assert config_loaded['characters'] != None
|
||||||
|
assert config_loaded['output_path'] in continue_path
|
||||||
|
assert config_loaded['test_delay_epochs'] == 0
|
||||||
|
|
||||||
|
# Load the model and run inference
|
||||||
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --speaker_idx {speaker_id} --speakers_file_path {continue_speakers_path} --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --speaker_idx {speaker_id} --speakers_file_path {continue_speakers_path} --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
||||||
run_cli(inference_command)
|
run_cli(inference_command)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import json
|
||||||
|
|
||||||
from trainer import get_last_checkpoint
|
from trainer import get_last_checkpoint
|
||||||
|
|
||||||
|
@ -54,6 +55,14 @@ continue_config_path = os.path.join(continue_path, "config.json")
|
||||||
continue_restore_path, _ = get_last_checkpoint(continue_path)
|
continue_restore_path, _ = get_last_checkpoint(continue_path)
|
||||||
out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
||||||
|
|
||||||
|
# Check integrity of the config
|
||||||
|
with open(continue_config_path, "r") as f:
|
||||||
|
config_loaded = json.load(f)
|
||||||
|
assert config_loaded['characters'] != None
|
||||||
|
assert config_loaded['output_path'] in continue_path
|
||||||
|
assert config_loaded['test_delay_epochs'] == 0
|
||||||
|
|
||||||
|
# Load the model and run inference
|
||||||
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
||||||
run_cli(inference_command)
|
run_cli(inference_command)
|
||||||
|
|
||||||
|
|
|
@ -1,53 +0,0 @@
|
||||||
import glob
|
|
||||||
import os
|
|
||||||
import shutil
|
|
||||||
|
|
||||||
from tests import get_device_id, get_tests_output_path, run_cli
|
|
||||||
from TTS.tts.configs.tacotron2_config import Tacotron2Config
|
|
||||||
|
|
||||||
config_path = os.path.join(get_tests_output_path(), "test_model_config.json")
|
|
||||||
output_path = os.path.join(get_tests_output_path(), "train_outputs")
|
|
||||||
|
|
||||||
config = Tacotron2Config(
|
|
||||||
r=5,
|
|
||||||
batch_size=8,
|
|
||||||
eval_batch_size=8,
|
|
||||||
num_loader_workers=0,
|
|
||||||
num_eval_loader_workers=0,
|
|
||||||
text_cleaner="english_cleaners",
|
|
||||||
use_phonemes=False,
|
|
||||||
phoneme_language="en-us",
|
|
||||||
phoneme_cache_path=os.path.join(get_tests_output_path(), "train_outputs/phoneme_cache/"),
|
|
||||||
run_eval=True,
|
|
||||||
test_delay_epochs=-1,
|
|
||||||
epochs=1,
|
|
||||||
print_step=1,
|
|
||||||
test_sentences=[
|
|
||||||
"Be a voice, not an echo.",
|
|
||||||
],
|
|
||||||
print_eval=True,
|
|
||||||
max_decoder_steps=50,
|
|
||||||
)
|
|
||||||
config.audio.do_trim_silence = True
|
|
||||||
config.audio.trim_db = 60
|
|
||||||
config.save_json(config_path)
|
|
||||||
|
|
||||||
# train the model for one epoch
|
|
||||||
command_train = (
|
|
||||||
f"CUDA_VISIBLE_DEVICES='{get_device_id()}' python TTS/bin/train_tts.py --config_path {config_path} "
|
|
||||||
f"--coqpit.output_path {output_path} "
|
|
||||||
"--coqpit.datasets.0.name ljspeech "
|
|
||||||
"--coqpit.datasets.0.meta_file_train metadata.csv "
|
|
||||||
"--coqpit.datasets.0.meta_file_val metadata.csv "
|
|
||||||
"--coqpit.datasets.0.path tests/data/ljspeech "
|
|
||||||
"--coqpit.test_delay_epochs 0 "
|
|
||||||
)
|
|
||||||
run_cli(command_train)
|
|
||||||
|
|
||||||
# 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_tts.py --continue_path {continue_path} "
|
|
||||||
run_cli(command_train)
|
|
||||||
shutil.rmtree(continue_path)
|
|
|
@ -1,6 +1,7 @@
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import json
|
||||||
|
|
||||||
from trainer import get_last_checkpoint
|
from trainer import get_last_checkpoint
|
||||||
|
|
||||||
|
@ -92,6 +93,14 @@ languae_id = "en"
|
||||||
continue_speakers_path = os.path.join(continue_path, "speakers.json")
|
continue_speakers_path = os.path.join(continue_path, "speakers.json")
|
||||||
continue_languages_path = os.path.join(continue_path, "language_ids.json")
|
continue_languages_path = os.path.join(continue_path, "language_ids.json")
|
||||||
|
|
||||||
|
# Check integrity of the config
|
||||||
|
with open(continue_config_path, "r") as f:
|
||||||
|
config_loaded = json.load(f)
|
||||||
|
assert config_loaded['characters'] != None
|
||||||
|
assert config_loaded['output_path'] in continue_path
|
||||||
|
assert config_loaded['test_delay_epochs'] == 0
|
||||||
|
|
||||||
|
# Load the model and run inference
|
||||||
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --speaker_idx {speaker_id} --speakers_file_path {continue_speakers_path} --language_ids_file_path {continue_languages_path} --language_idx {languae_id} --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --speaker_idx {speaker_id} --speakers_file_path {continue_speakers_path} --language_ids_file_path {continue_languages_path} --language_idx {languae_id} --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
||||||
run_cli(inference_command)
|
run_cli(inference_command)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import json
|
||||||
|
|
||||||
from trainer import get_last_checkpoint
|
from trainer import get_last_checkpoint
|
||||||
|
|
||||||
|
@ -99,6 +100,14 @@ languae_id = "en"
|
||||||
continue_speakers_path = config.d_vector_file
|
continue_speakers_path = config.d_vector_file
|
||||||
continue_languages_path = os.path.join(continue_path, "language_ids.json")
|
continue_languages_path = os.path.join(continue_path, "language_ids.json")
|
||||||
|
|
||||||
|
# Check integrity of the config
|
||||||
|
with open(continue_config_path, "r") as f:
|
||||||
|
config_loaded = json.load(f)
|
||||||
|
assert config_loaded['characters'] != None
|
||||||
|
assert config_loaded['output_path'] in continue_path
|
||||||
|
assert config_loaded['test_delay_epochs'] == 0
|
||||||
|
|
||||||
|
# Load the model and run inference
|
||||||
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --speaker_idx {speaker_id} --speakers_file_path {continue_speakers_path} --language_ids_file_path {continue_languages_path} --language_idx {languae_id} --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --speaker_idx {speaker_id} --speakers_file_path {continue_speakers_path} --language_ids_file_path {continue_languages_path} --language_idx {languae_id} --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
||||||
run_cli(inference_command)
|
run_cli(inference_command)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import json
|
||||||
|
|
||||||
from trainer import get_last_checkpoint
|
from trainer import get_last_checkpoint
|
||||||
|
|
||||||
|
@ -65,6 +66,14 @@ out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
||||||
speaker_id = "ljspeech-1"
|
speaker_id = "ljspeech-1"
|
||||||
continue_speakers_path = os.path.join(continue_path, "speakers.json")
|
continue_speakers_path = os.path.join(continue_path, "speakers.json")
|
||||||
|
|
||||||
|
# Check integrity of the config
|
||||||
|
with open(continue_config_path, "r") as f:
|
||||||
|
config_loaded = json.load(f)
|
||||||
|
assert config_loaded['characters'] != None
|
||||||
|
assert config_loaded['output_path'] in continue_path
|
||||||
|
assert config_loaded['test_delay_epochs'] == 0
|
||||||
|
|
||||||
|
# Load the model and run inference
|
||||||
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --speaker_idx {speaker_id} --speakers_file_path {continue_speakers_path} --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --speaker_idx {speaker_id} --speakers_file_path {continue_speakers_path} --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
||||||
run_cli(inference_command)
|
run_cli(inference_command)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import json
|
||||||
|
|
||||||
from trainer import get_last_checkpoint
|
from trainer import get_last_checkpoint
|
||||||
|
|
||||||
|
@ -54,6 +55,14 @@ continue_config_path = os.path.join(continue_path, "config.json")
|
||||||
continue_restore_path, _ = get_last_checkpoint(continue_path)
|
continue_restore_path, _ = get_last_checkpoint(continue_path)
|
||||||
out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
out_wav_path = os.path.join(get_tests_output_path(), "output.wav")
|
||||||
|
|
||||||
|
# Check integrity of the config
|
||||||
|
with open(continue_config_path, "r") as f:
|
||||||
|
config_loaded = json.load(f)
|
||||||
|
assert config_loaded['characters'] != None
|
||||||
|
assert config_loaded['output_path'] in continue_path
|
||||||
|
assert config_loaded['test_delay_epochs'] == 0
|
||||||
|
|
||||||
|
# Load the model and run inference
|
||||||
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
inference_command = f"CUDA_VISIBLE_DEVICES='{get_device_id()}' tts --text 'This is an example.' --config_path {continue_config_path} --model_path {continue_restore_path} --out_path {out_wav_path}"
|
||||||
run_cli(inference_command)
|
run_cli(inference_command)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue