Skip to content

Commit

Permalink
use unique experiment subfolder name when allowed by mk_experiment_fo…
Browse files Browse the repository at this point in the history
…lder=True (default)
  • Loading branch information
Zdeněk Hanzlíček committed Aug 14, 2023
1 parent 0ce8f72 commit 4eb56cf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ def __init__( # pylint: disable=dangerous-default-value
parse_command_line_args: bool = True,
callbacks: Dict[str, Callable] = {},
gpu: int = None,
mk_experiment_folder: bool = True,
) -> None:
"""Simple yet powerful 🐸💬 TTS trainer for PyTorch. It can train all the available `tts` and `vocoder` models
or easily be customized.
Expand Down Expand Up @@ -397,6 +398,9 @@ def __init__( # pylint: disable=dangerous-default-value
gpu (int):
GPU ID to use for training If "CUDA_VISIBLE_DEVICES" is not set. Defaults to None.
mk_experiment_folder (bool):
Create an experiment subfolder with a unique name (run-name and time-based). Defaults to True.
Example::
Running trainer with a model.
Expand Down Expand Up @@ -432,8 +436,11 @@ def __init__( # pylint: disable=dangerous-default-value
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, ZHa: use the given output folder
# output_path = get_experiment_folder_path(config.output_path, config.run_name)

# create a new unique output folder name (ZHa: when allowed by mk_experiment_folder)
if mk_experiment_folder:
output_path = get_experiment_folder_path(output_path, config.run_name)

os.makedirs(output_path, exist_ok=True)

# copy training assets to the output folder
Expand Down

0 comments on commit 4eb56cf

Please sign in to comment.