Skip to content

Commit

Permalink
reformat train.py using black
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaqili3 committed Jun 17, 2024
1 parent 20cee95 commit 122754c
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions bins/tts/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ def main():
# VALLETrainer.add_arguments(parser)
args = parser.parse_args()
cfg = load_config(args.config)

# Data Augmentation
if hasattr(cfg, 'preprocess'):
if hasattr(cfg, "preprocess"):
if hasattr(cfg.preprocess, "data_augment"):
if (
type(cfg.preprocess.data_augment) == list
Expand All @@ -108,14 +108,26 @@ def main():
new_datasets_list = []
for dataset in cfg.preprocess.data_augment:
new_datasets = [
f"{dataset}_pitch_shift" if cfg.preprocess.use_pitch_shift else None,
(
f"{dataset}_pitch_shift"
if cfg.preprocess.use_pitch_shift
else None
),
(
f"{dataset}_formant_shift"
if cfg.preprocess.use_formant_shift
else None
),
f"{dataset}_equalizer" if cfg.preprocess.use_equalizer else None,
f"{dataset}_time_stretch" if cfg.preprocess.use_time_stretch else None,
(
f"{dataset}_equalizer"
if cfg.preprocess.use_equalizer
else None
),
(
f"{dataset}_time_stretch"
if cfg.preprocess.use_time_stretch
else None
),
]
new_datasets_list.extend(filter(None, new_datasets))
cfg.dataset.extend(new_datasets_list)
Expand Down

0 comments on commit 122754c

Please sign in to comment.