|
| 1 | +name: Magpie-TTS-ML |
| 2 | + |
| 3 | +quadratic_duration: 20 # both training and validation datasets can apply same quadratic_duration. |
| 4 | +# Dataset metadata for each manifest |
| 5 | +# https://github.com/NVIDIA/NeMo/blob/main/nemo/collections/tts/data/vocoder_dataset.py#L39-L41 |
| 6 | +train_ds_meta: ??? |
| 7 | +val_ds_meta: ??? |
| 8 | + |
| 9 | +model: |
| 10 | + use_lhotse: true |
| 11 | + model_type: "decoder_ce" # single_encoder_sv_tts, decoder_context_tts or decoder_pretrain_synthesizer |
| 12 | + use_text_conditioning_encoder: true # If true, distilbert will be used to encode context_text if provided. |
| 13 | + text_conditioning_tokenizer_name: text_ce_tokenizer |
| 14 | + context_duration_min: 5.0 |
| 15 | + context_duration_max: 5.0 |
| 16 | + load_cached_codes_if_available: true |
| 17 | + prior_scaling_factor: 0.5 |
| 18 | + prior_end_step: 12000 |
| 19 | + prior_scaledown_start_step: 8000 |
| 20 | + indefinite_prior_prob: 0. # If > 0, then prior will be applied after prior_end_step with this probability. |
| 21 | + alignment_loss_scale: 0.002 |
| 22 | + embedding_dim: 768 |
| 23 | + codecmodel_path: ??? |
| 24 | + cfg_unconditional_prob: 0.1 |
| 25 | + # Alignment encoder parameters, to binarize the prior |
| 26 | + # This is used for attention-constrained training and inference |
| 27 | + use_alignment_encoder: false |
| 28 | + |
| 29 | + # Local transformer parameters for autoregressive codebook prediction within a frame |
| 30 | + local_transformer_type: "autoregressive" # "none", "autoregressive", "maskgit" |
| 31 | + # Below args are only relevant if use_local_transformer is true |
| 32 | + local_transformer_loss_scale: 1.0 |
| 33 | + local_transformer_n_layers: 1 |
| 34 | + local_transformer_n_heads: 1 |
| 35 | + local_transformer_hidden_dim: 256 |
| 36 | + |
| 37 | + text_context_remapping_json: null # JSON file defining mapping of multiple text contexts to a single text context. Does not need to cover all text contexts. |
| 38 | + text_context_remapping_prob: 0.0 # Probability of remapping the original text context to a remapped text context. |
| 39 | + |
| 40 | + text_tokenizers: # Add more languages for multi-lingual TTS |
| 41 | + english_phoneme: |
| 42 | + _target_: nemo.collections.common.tokenizers.text_to_speech.tts_tokenizers.IPATokenizer |
| 43 | + punct: true |
| 44 | + apostrophe: true |
| 45 | + pad_with_space: false |
| 46 | + g2p: |
| 47 | + _target_: nemo.collections.tts.g2p.models.i18n_ipa.IpaG2p |
| 48 | + phoneme_dict: "scripts/tts_dataset_files/ipa_cmudict-0.7b_nv23.01.txt" |
| 49 | + heteronyms: "scripts/tts_dataset_files/heteronyms-052722" |
| 50 | + phoneme_probability: 0.8 |
| 51 | + ignore_ambiguous_words: false |
| 52 | + use_chars: true |
| 53 | + use_stresses: true |
| 54 | + spanish_phoneme: |
| 55 | + _target_: nemo.collections.common.tokenizers.text_to_speech.tts_tokenizers.IPATokenizer |
| 56 | + locale: es-ES |
| 57 | + punct: true |
| 58 | + apostrophe: true |
| 59 | + pad_with_space: true |
| 60 | + g2p: |
| 61 | + _target_: nemo.collections.tts.g2p.models.i18n_ipa.IpaG2p |
| 62 | + locale: es-ES |
| 63 | + phoneme_dict: "scripts/tts_dataset_files/es_ES/es_ES_nv230301.dict" |
| 64 | + phoneme_probability: 0.8 |
| 65 | + ignore_ambiguous_words: false |
| 66 | + use_chars: true |
| 67 | + use_stresses: true |
| 68 | + german_phoneme: |
| 69 | + _target_: nemo.collections.common.tokenizers.text_to_speech.tts_tokenizers.IPATokenizer |
| 70 | + locale: de-DE |
| 71 | + punct: true |
| 72 | + apostrophe: true |
| 73 | + pad_with_space: true |
| 74 | + g2p: |
| 75 | + _target_: nemo.collections.tts.g2p.models.i18n_ipa.IpaG2p |
| 76 | + locale: 'de-DE' |
| 77 | + phoneme_dict: "scripts/tts_dataset_files/de/de_nv230119.dict" |
| 78 | + heteronyms: "scripts/tts_dataset_files/de/de_nv230119.heteronym" |
| 79 | + phoneme_probability: 0.8 |
| 80 | + ignore_ambiguous_words: false |
| 81 | + use_chars: true |
| 82 | + use_stresses: true |
| 83 | + grapheme_case: mixed |
| 84 | + grapheme_prefix: '#' |
| 85 | + mandarin_phoneme: |
| 86 | + _target_: nemo.collections.common.tokenizers.text_to_speech.tts_tokenizers.ChinesePhonemesTokenizer |
| 87 | + punct: true |
| 88 | + apostrophe: true |
| 89 | + pad_with_space: true |
| 90 | + g2p: |
| 91 | + _target_: nemo.collections.tts.g2p.models.zh_cn_pinyin.ChineseG2p |
| 92 | + phoneme_dict: "scripts/tts_dataset_files/zh/36finals/ipa_dict_nv23.05.txt" |
| 93 | + word_segmenter: "jieba" |
| 94 | + phoneme_prefix: "" |
| 95 | + phoneme_case: "lower" |
| 96 | + tone_prefix: "#" |
| 97 | + ascii_letter_prefix: "" |
| 98 | + ascii_letter_case: "upper" |
| 99 | + french_chartokenizer: |
| 100 | + _target_: AutoTokenizer |
| 101 | + pretrained_model: "google/byt5-small" |
| 102 | + hindi_phoneme: |
| 103 | + _target_: AutoTokenizer |
| 104 | + pretrained_model: "google/byt5-small" |
| 105 | + italian_phoneme: |
| 106 | + _target_: AutoTokenizer |
| 107 | + pretrained_model: "google/byt5-small" |
| 108 | + vietnamese_phoneme: |
| 109 | + _target_: AutoTokenizer |
| 110 | + pretrained_model: "google/byt5-small" |
| 111 | + text_ce_tokenizer: |
| 112 | + _target_: AutoTokenizer |
| 113 | + pretrained_model: "google/byt5-small" |
| 114 | + |
| 115 | + train_ds: |
| 116 | + use_lhotse: ${model.use_lhotse} |
| 117 | + volume_norm: true |
| 118 | + |
| 119 | + dataset: |
| 120 | + min_duration: 0.2 |
| 121 | + min_context_speaker_similarity: 0.6 |
| 122 | + max_cer: 0.03 |
| 123 | + batch_duration : ??? # in seconds. Adjust based on your GPU memory. |
| 124 | + quadratic_duration: ${quadratic_duration} |
| 125 | + use_bucketing: true |
| 126 | + num_buckets: 20 |
| 127 | + bucket_buffer_size: 20_000 |
| 128 | + shuffle_buffer_size: 20_000 |
| 129 | + num_cuts_for_bins_estimate: 20_000 |
| 130 | + shard_seed: "trng" |
| 131 | + drop_last: true |
| 132 | + shuffle: true |
| 133 | + num_workers: 6 |
| 134 | + pin_memory: true |
| 135 | + |
| 136 | + input_cfg: |
| 137 | + - type: lhotse_shar |
| 138 | + shar_path: ??? |
| 139 | + weight: 1.0 |
| 140 | + tags: |
| 141 | + tokenizer_names: ["english_phoneme"] |
| 142 | + |
| 143 | + |
| 144 | + validation_ds: |
| 145 | + use_lhotse: ${model.use_lhotse} |
| 146 | + volume_norm: true |
| 147 | + |
| 148 | + dataset: |
| 149 | + min_duration: 0.2 |
| 150 | + min_context_speaker_similarity: 0.6 |
| 151 | + max_cer: 0.03 |
| 152 | + batch_duration: ??? # recommend to use smaller batch_duration for validation dataset than training dataset. |
| 153 | + quadratic_duration: ${quadratic_duration} |
| 154 | + use_bucketing: false |
| 155 | + force_finite: true |
| 156 | + drop_last: false |
| 157 | + shuffle: false |
| 158 | + num_workers: 2 |
| 159 | + pin_memory: true |
| 160 | + |
| 161 | + input_cfg: |
| 162 | + - type: lhotse_shar |
| 163 | + shar_path: ??? |
| 164 | + weight: 1.0 |
| 165 | + tags: |
| 166 | + tokenizer_names: ["english_phoneme"] |
| 167 | + |
| 168 | + encoder: |
| 169 | + n_layers: 6 |
| 170 | + d_model: 768 |
| 171 | + d_ffn: 3072 |
| 172 | + sa_n_heads: 12 |
| 173 | + kernel_size: 3 |
| 174 | + p_dropout: 0.1 |
| 175 | + p_dropout_out: 0.0 |
| 176 | + has_xattn: false |
| 177 | + is_causal: true |
| 178 | + apply_norm_out: true |
| 179 | + max_length_causal_mask: 2048 |
| 180 | + use_learnable_pos_emb: true |
| 181 | + |
| 182 | + context_encoder: # Only used for multi_encoder_context_tts and decoder_ce |
| 183 | + n_layers: 1 |
| 184 | + d_model: 768 |
| 185 | + d_ffn: 3072 |
| 186 | + sa_n_heads: 12 |
| 187 | + kernel_size: 3 |
| 188 | + p_dropout: 0.1 |
| 189 | + p_dropout_out: 0.0 |
| 190 | + has_xattn: false |
| 191 | + is_causal: false |
| 192 | + apply_norm_out: true |
| 193 | + max_length_causal_mask: 2048 |
| 194 | + use_learnable_pos_emb: true |
| 195 | + |
| 196 | + decoder: |
| 197 | + n_layers: 12 |
| 198 | + d_model: 768 |
| 199 | + d_ffn: 3072 |
| 200 | + sa_n_heads: 12 |
| 201 | + kernel_size: 1 |
| 202 | + p_dropout: 0.1 |
| 203 | + p_dropout_out: 0.0 |
| 204 | + has_xattn: true |
| 205 | + xa_d_head: 128 |
| 206 | + xa_d_memory: 768 |
| 207 | + xa_n_heads: 1 |
| 208 | + is_causal: true |
| 209 | + apply_norm_to_cond: true |
| 210 | + apply_norm_out: true |
| 211 | + max_length_causal_mask: 2048 |
| 212 | + use_learnable_pos_emb: true |
| 213 | + make_prior_window_strict: true |
| 214 | + |
| 215 | + optim: |
| 216 | + _target_: torch.optim.AdamW |
| 217 | + lr: 2e-4 |
| 218 | + |
| 219 | + sched: |
| 220 | + name: ExponentialLR |
| 221 | + gamma: 0.998 |
| 222 | + |
| 223 | +trainer: |
| 224 | + num_nodes: 1 |
| 225 | + devices: -1 |
| 226 | + accelerator: gpu |
| 227 | + strategy: ddp_find_unused_parameters_true |
| 228 | + precision: 32 |
| 229 | + max_steps: ??? |
| 230 | + accumulate_grad_batches: 1 |
| 231 | + enable_checkpointing: False # Provided by exp_manager |
| 232 | + logger: false # Provided by exp_manager |
| 233 | + log_every_n_steps: 100 |
| 234 | + check_val_every_n_epoch: 1 |
| 235 | + limit_train_batches: 1_000 |
| 236 | + val_check_interval: 1_000 |
| 237 | + num_sanity_val_steps: 0 |
| 238 | + benchmark: false |
| 239 | + use_distributed_sampler: false # required because Lhotse has its own handling |
| 240 | + gradient_clip_val: 2.5 |
| 241 | + |
| 242 | +exp_manager: |
| 243 | + exp_dir: null |
| 244 | + name: ${name} |
| 245 | + create_tensorboard_logger: true |
| 246 | + create_wandb_logger: false |
| 247 | + wandb_logger_kwargs: |
| 248 | + entity: null |
| 249 | + project: null |
| 250 | + group: null |
| 251 | + name: ${name} |
| 252 | + resume: true # enable resume to ensure continuous training log metrics merged on the previous run id. |
| 253 | + create_checkpoint_callback: true |
| 254 | + checkpoint_callback_params: |
| 255 | + monitor: val_loss |
| 256 | + mode: min |
| 257 | + save_top_k: 5 |
| 258 | + save_best_model: true |
| 259 | + always_save_nemo: true |
| 260 | + resume_if_exists: true |
| 261 | + resume_ignore_no_checkpoint: true |
0 commit comments