lopezjm96 commited on
Commit
40e0360
1 Parent(s): 3db5483

First attempt

Browse files
Files changed (3) hide show
  1. G_spanish.pth +3 -0
  2. HOW I GOT THIS.txt +17 -0
  3. config.json +246 -0
G_spanish.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8605793ac895db14ca69b371061c827f5d1bf0084c26934d73469a07c1f3726e
3
+ size 655915196
HOW I GOT THIS.txt ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Using COQUI-AI TTS repo https://github.com/coqui-ai/TTS
2
+ the default spanish VITS model is in .tar format, so I used the finetuning
3
+ functionality but with only 1 epoch and all learning rates in 0.0
4
+
5
+ - Clone repo
6
+ - follow instructions for installation, currently doing cd /repo/path && pip install -e .[all,dev,notebooks]
7
+ - Generate any text with vits spanish model to download the model, currenty: tts --model_name tts/es/cs100/vits --text "hola hola hola" --out_path /anywhere/
8
+ - Go to directory of downloaded model, normally /user/.local/tts/vits
9
+ - copy config.json and model.pth.tar
10
+ - customize config.json to train only 1 epoch and all lr to 0.0 (including lr_gen & lr_disc) and settings for your database, even when you don't want to train, you need some dataset to act as if it was going to train
11
+ - finetune, currently: CUDA_VISIBLE_DEVICES="0" python /path/to/repo/TTS/TTS/bin/train_tts.py --config_path /path/to/custom/config/config.json --restore_path /path/to/model/model_file.pth.tar --use_cuda True
12
+
13
+ Some troubles I found and how I solved them:
14
+
15
+ - If training throws error of "Vits has no disc", on confing.json set initialize_disc to true.
16
+ - Always needs at least one file for evaluation, so set eval_split_size so that it gets at least one file, for me it crashed when using no evaluation.
17
+ - If throws some error about no more data, check the data filters in config.json, such as min and max length. It could be that all your audio and/or text data is being filtered out.
config.json ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "output_path": "/home/usuario18/python_scripts/TTS/attempts/",
3
+ "logger_uri": null,
4
+ "run_name": "noEpochsVits",
5
+ "project_name": null,
6
+ "run_description": "",
7
+ "print_step": 25,
8
+ "plot_step": 100,
9
+ "model_param_stats": false,
10
+ "wandb_entity": null,
11
+ "dashboard_logger": "tensorboard",
12
+ "log_model_step": null,
13
+ "save_step": 10000,
14
+ "save_n_checkpoints": 5,
15
+ "save_checkpoints": true,
16
+ "save_all_best": false,
17
+ "save_best_after": 10000,
18
+ "target_loss": null,
19
+ "print_eval": false,
20
+ "test_delay_epochs": -1,
21
+ "run_eval": true,
22
+ "run_eval_steps": null,
23
+ "distributed_backend": "nccl",
24
+ "distributed_url": "tcp://localhost:54321",
25
+ "mixed_precision": true,
26
+ "epochs": 1,
27
+ "batch_size": 4,
28
+ "eval_batch_size": 1,
29
+ "grad_clip": [
30
+ 1000.0,
31
+ 1000.0
32
+ ],
33
+ "scheduler_after_epoch": true,
34
+ "lr": 0.0,
35
+ "optimizer": "AdamW",
36
+ "optimizer_params": {
37
+ "betas": [
38
+ 0.8,
39
+ 0.99
40
+ ],
41
+ "eps": 1e-09,
42
+ "weight_decay": 0.01
43
+ },
44
+ "lr_scheduler": "",
45
+ "lr_scheduler_params": null,
46
+ "use_grad_scaler": false,
47
+ "cudnn_enable": true,
48
+ "cudnn_deterministic": false,
49
+ "cudnn_benchmark": false,
50
+ "training_seed": 54321,
51
+ "model": "vits",
52
+ "num_loader_workers": 8,
53
+ "num_eval_loader_workers": 8,
54
+ "use_noise_augment": false,
55
+ "audio": {
56
+ "fft_size": 1024,
57
+ "sample_rate": 22050,
58
+ "win_length": 1024,
59
+ "hop_length": 256,
60
+ "num_mels": 80,
61
+ "mel_fmin": 0,
62
+ "mel_fmax": null
63
+ },
64
+ "use_phonemes": false,
65
+ "phonemizer": null,
66
+ "phoneme_language": null,
67
+ "compute_input_seq_cache": true,
68
+ "text_cleaner": "multilingual_cleaners",
69
+ "enable_eos_bos_chars": false,
70
+ "test_sentences_file": "",
71
+ "phoneme_cache_path": null,
72
+ "characters": {
73
+ "characters_class": "TTS.tts.utils.text.characters.Graphemes",
74
+ "vocab_dict": null,
75
+ "pad": "<PAD>",
76
+ "eos": "<EOS>",
77
+ "bos": "<BOS>",
78
+ "blank": "<BLNK>",
79
+ "characters": "abcdefghijklmnopqrstuvwxyz\u00af\u00b7\u00df\u00e0\u00e1\u00e2\u00e3\u00e4\u00e6\u00e7\u00e8\u00e9\u00ea\u00eb\u00ec\u00ed\u00ee\u00ef\u00f1\u00f2\u00f3\u00f4\u00f5\u00f6\u00f9\u00fa\u00fb\u00fc\u00ff\u0101\u0105\u0107\u0113\u0119\u011b\u012b\u0131\u0142\u0144\u014d\u0151\u0153\u015b\u016b\u0171\u017a\u017c\u01ce\u01d0\u01d2\u01d4\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u044f\u0451\u0454\u0456\u0457\u0491",
80
+ "punctuations": "!'(),-.:;? ",
81
+ "phonemes": null,
82
+ "is_unique": true,
83
+ "is_sorted": true
84
+ },
85
+ "add_blank": true,
86
+ "batch_group_size": 0,
87
+ "loss_masking": null,
88
+ "min_audio_len": 22050,
89
+ "max_audio_len": 661500,
90
+ "min_text_len": 1,
91
+ "max_text_len": Infinity,
92
+ "compute_f0": false,
93
+ "compute_energy": false,
94
+ "compute_linear_spec": true,
95
+ "precompute_num_workers": 12,
96
+ "start_by_longest": false,
97
+ "shuffle": false,
98
+ "drop_last": false,
99
+ "datasets": [
100
+ {
101
+ "formatter": "ljspeech",
102
+ "dataset_name": "",
103
+ "path": "/home/usuario18/python_scripts/TTS/attempts/100mejorespoesias/manual/",
104
+ "meta_file_train": "metadata.csv",
105
+ "ignored_speakers": null,
106
+ "language": "es",
107
+ "phonemizer": "",
108
+ "meta_file_val": "",
109
+ "meta_file_attn_mask": ""
110
+ }
111
+ ],
112
+ "test_sentences": [],
113
+ "eval_split_max_size": null,
114
+ "eval_split_size": 0.2,
115
+ "use_speaker_weighted_sampler": false,
116
+ "speaker_weighted_sampler_alpha": 1.0,
117
+ "use_language_weighted_sampler": true,
118
+ "language_weighted_sampler_alpha": 1.0,
119
+ "use_length_weighted_sampler": false,
120
+ "length_weighted_sampler_alpha": 1.0,
121
+ "model_args": {
122
+ "num_chars": 129,
123
+ "out_channels": 513,
124
+ "spec_segment_size": 32,
125
+ "hidden_channels": 192,
126
+ "hidden_channels_ffn_text_encoder": 768,
127
+ "num_heads_text_encoder": 2,
128
+ "num_layers_text_encoder": 6,
129
+ "kernel_size_text_encoder": 3,
130
+ "dropout_p_text_encoder": 0.1,
131
+ "dropout_p_duration_predictor": 0.5,
132
+ "kernel_size_posterior_encoder": 5,
133
+ "dilation_rate_posterior_encoder": 1,
134
+ "num_layers_posterior_encoder": 16,
135
+ "kernel_size_flow": 5,
136
+ "dilation_rate_flow": 1,
137
+ "num_layers_flow": 4,
138
+ "resblock_type_decoder": "2",
139
+ "resblock_kernel_sizes_decoder": [
140
+ 3,
141
+ 5,
142
+ 7
143
+ ],
144
+ "resblock_dilation_sizes_decoder": [
145
+ [
146
+ 1,
147
+ 2
148
+ ],
149
+ [
150
+ 2,
151
+ 6
152
+ ],
153
+ [
154
+ 3,
155
+ 12
156
+ ]
157
+ ],
158
+ "upsample_rates_decoder": [
159
+ 8,
160
+ 8,
161
+ 4
162
+ ],
163
+ "upsample_initial_channel_decoder": 256,
164
+ "upsample_kernel_sizes_decoder": [
165
+ 16,
166
+ 16,
167
+ 8
168
+ ],
169
+ "periods_multi_period_discriminator": [
170
+ 2,
171
+ 3,
172
+ 5,
173
+ 7,
174
+ 11
175
+ ],
176
+ "use_sdp": true,
177
+ "noise_scale": 1.0,
178
+ "inference_noise_scale": 0.3,
179
+ "length_scale": 1.0,
180
+ "noise_scale_dp": 1.0,
181
+ "inference_noise_scale_dp": 0.3,
182
+ "max_inference_len": null,
183
+ "init_discriminator": true,
184
+ "use_spectral_norm_disriminator": false,
185
+ "use_speaker_embedding": false,
186
+ "num_speakers": 0,
187
+ "speakers_file": "/home/usuario18/python_scripts/TTS/attempts/vits_finetune/speaker_ids.json",
188
+ "d_vector_file": null,
189
+ "speaker_embedding_channels": 256,
190
+ "use_d_vector_file": false,
191
+ "d_vector_dim": 0,
192
+ "detach_dp_input": true,
193
+ "use_language_embedding": false,
194
+ "embedded_language_dim": 4,
195
+ "num_languages": 1,
196
+ "language_ids_file": null,
197
+ "use_speaker_encoder_as_loss": false,
198
+ "speaker_encoder_config_path": "",
199
+ "speaker_encoder_model_path": "",
200
+ "condition_dp_on_speaker": true,
201
+ "freeze_encoder": false,
202
+ "freeze_DP": false,
203
+ "freeze_PE": false,
204
+ "freeze_flow_decoder": false,
205
+ "freeze_waveform_decoder": false,
206
+ "encoder_sample_rate": null,
207
+ "interpolate_z": true,
208
+ "reinit_DP": false,
209
+ "reinit_text_encoder": false
210
+ },
211
+ "lr_gen": 0.0,
212
+ "lr_disc": 0.0,
213
+ "lr_scheduler_gen": "ExponentialLR",
214
+ "lr_scheduler_gen_params": {
215
+ "gamma": 0.999875,
216
+ "last_epoch": -1
217
+ },
218
+ "lr_scheduler_disc": "ExponentialLR",
219
+ "lr_scheduler_disc_params": {
220
+ "gamma": 0.999875,
221
+ "last_epoch": -1
222
+ },
223
+ "kl_loss_alpha": 1.0,
224
+ "disc_loss_alpha": 1.0,
225
+ "gen_loss_alpha": 1.0,
226
+ "feat_loss_alpha": 1.0,
227
+ "mel_loss_alpha": 45.0,
228
+ "dur_loss_alpha": 1.0,
229
+ "speaker_encoder_loss_alpha": 1.0,
230
+ "return_wav": true,
231
+ "use_weighted_sampler": false,
232
+ "weighted_sampler_attrs": null,
233
+ "weighted_sampler_multipliers": null,
234
+ "r": 1,
235
+ "num_speakers": 1,
236
+ "use_speaker_embedding": false,
237
+ "speakers_file": "/home/usuario18/python_scripts/TTS/attempts/vits_finetune/speaker_ids.json",
238
+ "speaker_embedding_channels": 256,
239
+ "language_ids_file": null,
240
+ "use_language_embedding": false,
241
+ "use_d_vector_file": false,
242
+ "d_vector_file": null,
243
+ "d_vector_dim": 0,
244
+ "restore_path": "/home/usuario18/python_scripts/TTS/attempts/vits_finetune/model_file.pth.tar",
245
+ "github_branch": "* dev"
246
+ }