From b4b890df03b24f3bff2ce24f98b3a7fe22210cef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eren=20G=C3=B6lge?= Date: Mon, 18 Oct 2021 08:53:19 +0000 Subject: [PATCH] Update trainer's initialization --- TTS/trainer.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/TTS/trainer.py b/TTS/trainer.py index aa925972..7a38616d 100644 --- a/TTS/trainer.py +++ b/TTS/trainer.py @@ -182,16 +182,24 @@ class Trainer: - TPU training - NOTE: Consider moving `training_assets` to the model implementation. """ + if parse_command_line_args: - # parse command-line arguments for TrainingArgs() + # parse command-line arguments for TrainerArgs() args, coqpit_overrides = self.parse_argv(args) # get ready for training and parse command-line arguments for the model config config = self.init_training(args, coqpit_overrides, config) - # define the experiment path and create the folder - output_path = get_experiment_folder_path(config.output_path, config.run_name) - os.makedirs(output_path, exist_ok=True) + # set the output path + if args.continue_path: + # use the same path as the continuing run + output_path = args.continue_path + else: + # override the output path if it is provided + output_path = config.output_path if output_path is None else output_path + # create a new output folder name + output_path = get_experiment_folder_path(config.output_path, config.run_name) + os.makedirs(output_path, exist_ok=True) # copy training assets to the output folder copy_model_files(config, output_path, new_fields=None)