Yurii Paniv commited on
Commit
8472231
1 Parent(s): c7de0f6

Add improved "Mykyta" model with stress support

Browse files
Files changed (4) hide show
  1. .gitignore +2 -1
  2. app.py +6 -6
  3. config.json +122 -75
  4. requirements.txt +1 -1
.gitignore CHANGED
@@ -129,4 +129,5 @@ dmypy.json
129
  .pyre/
130
 
131
  # model files
132
- *.pth.tar
 
 
129
  .pyre/
130
 
131
  # model files
132
+ *.pth.tar
133
+ *.pth
app.py CHANGED
@@ -9,7 +9,7 @@ from os.path import exists
9
  from formatter import preprocess_text
10
 
11
  MODEL_NAMES = [
12
- "uk/mai/vits-tts"
13
  ]
14
  MODELS = {}
15
 
@@ -28,11 +28,11 @@ def download(url, file_name):
28
 
29
  for MODEL_NAME in MODEL_NAMES:
30
  print(f"downloading {MODEL_NAME}")
31
- release_number = "1.0.0"
32
- model_link = f"https://github.com/robinhad/ukrainian-tts/releases/download/v{release_number}/model.pth.tar"
33
- config_link = f"https://github.com/robinhad/ukrainian-tts/releases/download/v{release_number}/config.json"
34
 
35
- model_path = "model.pth.tar"
36
  config_path = "config.json"
37
 
38
  download(model_link, model_path)
@@ -74,7 +74,7 @@ iface = gr.Interface(
74
  outputs=gr.outputs.Audio(label="Output"),
75
  title="🐸💬🇺🇦 - Coqui TTS",
76
  theme="huggingface",
77
- description="Україномовний🇺🇦 TTS за допомогою Coqui TTS (для апострофа використовуйте символ у трикутних дужках: <'>)",
78
  article="Якщо вам подобається, підтримайте за посиланням: [SUPPORT LINK](https://send.monobank.ua/jar/48iHq4xAXm), " +
79
  "Github: [https://github.com/robinhad/ukrainian-tts](https://github.com/robinhad/ukrainian-tts)",
80
  )
 
9
  from formatter import preprocess_text
10
 
11
  MODEL_NAMES = [
12
+ "uk/mykyta/vits-tts"
13
  ]
14
  MODELS = {}
15
 
 
28
 
29
  for MODEL_NAME in MODEL_NAMES:
30
  print(f"downloading {MODEL_NAME}")
31
+ release_number = "v2.0.0-beta"
32
+ model_link = f"https://github.com/robinhad/ukrainian-tts/releases/download/{release_number}/model.pth"
33
+ config_link = f"https://github.com/robinhad/ukrainian-tts/releases/download/{release_number}/config.json"
34
 
35
+ model_path = "model.pth"
36
  config_path = "config.json"
37
 
38
  download(model_link, model_path)
 
74
  outputs=gr.outputs.Audio(label="Output"),
75
  title="🐸💬🇺🇦 - Coqui TTS",
76
  theme="huggingface",
77
+ description="Україномовний🇺🇦 TTS за допомогою Coqui TTS (для наголосу використовуйте + перед голосною)",
78
  article="Якщо вам подобається, підтримайте за посиланням: [SUPPORT LINK](https://send.monobank.ua/jar/48iHq4xAXm), " +
79
  "Github: [https://github.com/robinhad/ukrainian-tts](https://github.com/robinhad/ukrainian-tts)",
80
  )
config.json CHANGED
@@ -1,32 +1,56 @@
1
  {
2
- "model": "vits",
3
- "run_name": "vits_ljspeech",
4
- "run_description": "",
5
- "epochs": 1000,
6
- "batch_size": 18,
7
- "eval_batch_size": 16,
8
- "mixed_precision": true,
9
- "scheduler_after_epoch": true,
10
- "run_eval": true,
11
- "test_delay_epochs": -1,
12
- "print_eval": true,
13
- "dashboard_logger": "tensorboard",
14
  "print_step": 25,
15
  "plot_step": 100,
16
  "model_param_stats": false,
17
- "project_name": null,
18
- "log_model_step": null,
19
  "wandb_entity": null,
 
 
20
  "save_step": 10000,
21
- "checkpoint": true,
22
- "keep_all_best": false,
23
- "keep_after": 10000,
24
- "num_loader_workers": 12,
25
- "num_eval_loader_workers": 12,
26
- "use_noise_augment": false,
27
- "output_path": "./ukrainian-vits",
 
28
  "distributed_backend": "nccl",
29
  "distributed_url": "tcp://localhost:54321",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  "audio": {
31
  "fft_size": 1024,
32
  "win_length": 1024,
@@ -34,23 +58,27 @@
34
  "frame_shift_ms": null,
35
  "frame_length_ms": null,
36
  "stft_pad_mode": "reflect",
37
- "sample_rate": 16000,
38
  "resample": false,
39
  "preemphasis": 0.0,
40
  "ref_level_db": 20,
41
- "do_sound_norm": false,
42
- "log_func": "np.log",
43
  "do_trim_silence": true,
44
  "trim_db": 45,
45
- "power": 1.3,
 
 
46
  "griffin_lim_iters": 60,
47
  "num_mels": 80,
48
  "mel_fmin": 0.0,
49
  "mel_fmax": null,
50
  "spec_gain": 1,
51
- "do_amp_to_db_linear": false,
52
  "do_amp_to_db_mel": true,
53
- "signal_norm": false,
 
 
54
  "min_level_db": -100,
55
  "symmetric_norm": true,
56
  "max_norm": 4.0,
@@ -58,68 +86,73 @@
58
  "stats_path": null
59
  },
60
  "use_phonemes": false,
61
- "use_espeak_phonemes": true,
62
- "phoneme_language": null,
63
- "compute_input_seq_cache": true,
64
  "text_cleaner": "basic_cleaners",
65
  "enable_eos_bos_chars": false,
66
  "test_sentences_file": "",
67
- "phoneme_cache_path": "./ukrainian/phoneme_cache",
68
  "characters": {
69
- "pad": "_",
70
- "eos": "~",
71
- "bos": "^",
72
- "characters": "!',-.:;?\u0410\u0411\u0412\u0413\u0490\u0414\u0415\u0404\u0416\u0417\u0418\u0406\u0407\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042c\u042e\u042f\u0430\u0431\u0432\u0433\u0491\u0434\u0435\u0454\u0436\u0437\u0438\u0456\u0457\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044c\u044e\u044f ",
73
- "punctuations": "!',-.:;? ",
 
 
 
74
  "phonemes": null,
75
- "unique": true
 
76
  },
77
- "batch_group_size": 5,
 
78
  "loss_masking": null,
79
- "sort_by_audio_len": true,
80
- "min_seq_len": 0,
81
- "max_seq_len": 500000,
 
 
82
  "compute_f0": false,
83
  "compute_linear_spec": true,
84
- "add_blank": true,
 
85
  "datasets": [
86
  {
87
  "name": "ljspeech",
88
- "path": "./Data/uk_UK/by_book/female/sumska/kaydasheva",
89
- "meta_file_train": "metadata.csv",
90
- "ununsed_speakers": null,
91
- "meta_file_val": "",
92
- "meta_file_attn_mask": ""
93
- },
94
- {
95
- "name": "ljspeech",
96
- "path": "./Data/uk_UK/by_book/female/sumska/mykola_djerya",
97
  "meta_file_train": "metadata.csv",
98
- "ununsed_speakers": null,
 
99
  "meta_file_val": "",
100
  "meta_file_attn_mask": ""
101
  }
102
  ],
103
- "optimizer": "AdamW",
104
- "optimizer_params": {
105
- "betas": [
106
- 0.8,
107
- 0.99
108
- ],
109
- "eps": 1e-09,
110
- "weight_decay": 0.01
111
- },
112
- "lr_scheduler": "",
113
- "lr_scheduler_params": {},
114
  "test_sentences": [
115
- "\u0413\u043e\u0432\u043e\u0440\u0438 \u043d\u0456\u0431\u0438 \u0442\u0438 \u0436\u0438\u0432\u0438\u0439!",
116
- "\u041f\u043e\u043b \u043f\u0435\u0440\u0435\u0442\u043d\u0443\u0432 \u043f\u0443\u0441\u0442\u0435\u043b\u044e",
117
- "\u041f\u0440\u0438\u0432\u0456\u0442, \u0441\u0432\u0456\u0442\u0435!"
 
 
 
 
 
 
 
 
 
118
  ],
 
 
 
 
 
 
119
  "model_args": {
120
- "num_chars": 86,
121
  "out_channels": 513,
122
- "spec_segment_size": 24,
123
  "hidden_channels": 192,
124
  "hidden_channels_ffn_text_encoder": 768,
125
  "num_heads_text_encoder": 2,
@@ -181,16 +214,25 @@
181
  "use_speaker_embedding": false,
182
  "num_speakers": 0,
183
  "speakers_file": null,
 
184
  "speaker_embedding_channels": 256,
185
  "use_d_vector_file": false,
186
- "d_vector_file": null,
187
  "d_vector_dim": 0,
188
- "detach_dp_input": true
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  },
190
- "grad_clip": [
191
- 1000.0,
192
- 1000.0
193
- ],
194
  "lr_gen": 0.0002,
195
  "lr_disc": 0.0002,
196
  "lr_scheduler_gen": "ExponentialLR",
@@ -209,13 +251,18 @@
209
  "feat_loss_alpha": 1.0,
210
  "mel_loss_alpha": 45.0,
211
  "dur_loss_alpha": 1.0,
 
212
  "return_wav": true,
213
  "r": 1,
214
  "num_speakers": 0,
215
  "use_speaker_embedding": false,
216
  "speakers_file": null,
217
  "speaker_embedding_channels": 256,
 
 
218
  "use_d_vector_file": false,
219
  "d_vector_file": null,
220
- "d_vector_dim": 0
 
 
221
  }
 
1
  {
2
+ "output_path": "./model",
3
+ "logger_uri": null,
4
+ "run_name": "vits_mykyta",
5
+ "project_name": null,
6
+ "run_description": "\ud83d\udc38Coqui trainer run.",
 
 
 
 
 
 
 
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
  "distributed_backend": "nccl",
23
  "distributed_url": "tcp://localhost:54321",
24
+ "mixed_precision": true,
25
+ "epochs": 1000,
26
+ "batch_size": 32,
27
+ "eval_batch_size": 16,
28
+ "grad_clip": [
29
+ 1000.0,
30
+ 1000.0
31
+ ],
32
+ "scheduler_after_epoch": true,
33
+ "lr": 0.001,
34
+ "optimizer": "AdamW",
35
+ "optimizer_params": {
36
+ "betas": [
37
+ 0.8,
38
+ 0.99
39
+ ],
40
+ "eps": 1e-09,
41
+ "weight_decay": 0.01
42
+ },
43
+ "lr_scheduler": "",
44
+ "lr_scheduler_params": {},
45
+ "use_grad_scaler": false,
46
+ "cudnn_enable": true,
47
+ "cudnn_deterministic": false,
48
+ "cudnn_benchmark": true,
49
+ "training_seed": 54321,
50
+ "model": "vits",
51
+ "num_loader_workers": 8,
52
+ "num_eval_loader_workers": 8,
53
+ "use_noise_augment": false,
54
  "audio": {
55
  "fft_size": 1024,
56
  "win_length": 1024,
 
58
  "frame_shift_ms": null,
59
  "frame_length_ms": null,
60
  "stft_pad_mode": "reflect",
61
+ "sample_rate": 48000,
62
  "resample": false,
63
  "preemphasis": 0.0,
64
  "ref_level_db": 20,
65
+ "do_sound_norm": true,
66
+ "log_func": "np.log10",
67
  "do_trim_silence": true,
68
  "trim_db": 45,
69
+ "do_rms_norm": false,
70
+ "db_level": null,
71
+ "power": 1.5,
72
  "griffin_lim_iters": 60,
73
  "num_mels": 80,
74
  "mel_fmin": 0.0,
75
  "mel_fmax": null,
76
  "spec_gain": 1,
77
+ "do_amp_to_db_linear": true,
78
  "do_amp_to_db_mel": true,
79
+ "pitch_fmax": 640.0,
80
+ "pitch_fmin": 0.0,
81
+ "signal_norm": true,
82
  "min_level_db": -100,
83
  "symmetric_norm": true,
84
  "max_norm": 4.0,
 
86
  "stats_path": null
87
  },
88
  "use_phonemes": false,
89
+ "phonemizer": null,
90
+ "phoneme_language": "uk",
91
+ "compute_input_seq_cache": false,
92
  "text_cleaner": "basic_cleaners",
93
  "enable_eos_bos_chars": false,
94
  "test_sentences_file": "",
95
+ "phoneme_cache_path": "./phoneme_cache",
96
  "characters": {
97
+ "characters_class": "TTS.tts.models.vits.VitsCharacters",
98
+ "vocab_dict": null,
99
+ "pad": "<PAD>",
100
+ "eos": "<EOS>",
101
+ "bos": "<BOS>",
102
+ "blank": "<BLNK>",
103
+ "characters": "!\"'(),-/:;?\u00ab\u00bb+\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\u044c\u044e\u044f\u0454\u0456\u0457\u0491\u2013\u2014\u2015\u2018\u2019\u201c\u201d\u201e\u2026 ",
104
+ "punctuations": "!\"'(),-/:;?\u00ab\u00bb+\u2013\u2014\u2015\u2018\u2019\u201c\u201d\u201e\u2026 ",
105
  "phonemes": null,
106
+ "is_unique": true,
107
+ "is_sorted": true
108
  },
109
+ "add_blank": true,
110
+ "batch_group_size": 0,
111
  "loss_masking": null,
112
+ "sort_by_audio_len": false,
113
+ "min_audio_len": 24000,
114
+ "max_audio_len": 624000,
115
+ "min_text_len": 1,
116
+ "max_text_len": Infinity,
117
  "compute_f0": false,
118
  "compute_linear_spec": true,
119
+ "precompute_num_workers": 8,
120
+ "start_by_longest": false,
121
  "datasets": [
122
  {
123
  "name": "ljspeech",
124
+ "path": "./dataset",
 
 
 
 
 
 
 
 
125
  "meta_file_train": "metadata.csv",
126
+ "ignored_speakers": null,
127
+ "language": "",
128
  "meta_file_val": "",
129
  "meta_file_attn_mask": ""
130
  }
131
  ],
 
 
 
 
 
 
 
 
 
 
 
132
  "test_sentences": [
133
+ [
134
+ "\u0413\u043e\u0432\u043e\u0440+\u0438, \u043d+\u0456\u0431\u0438 \u0442+\u0438 \u0436\u0438\u0432+\u0438\u0439!"
135
+ ],
136
+ [
137
+ "\u041f\u0435\u0440\u0435\u043f\u0440+\u043e\u0448\u0443\u044e, \u0414+\u0435\u0439\u0432\u0435, \u043d+\u0430 \u0436+\u0430\u043b\u044c, +\u044f \u043d+\u0435 \u043c+\u043e\u0436\u0443 \u0437\u0440\u043e\u0431+\u0438\u0442\u0438 \u0446+\u0435."
138
+ ],
139
+ [
140
+ "\u0425\u0442+\u043e \u0442+\u0438 \u0442\u0430\u043a+\u0438\u0439 +\u0456 +\u044f\u043a \u0442\u0435\u0431+\u0435 \u0437\u0432+\u0430\u0442\u0438?"
141
+ ],
142
+ [
143
+ "\u041a+\u0430\u043c'\u044f\u043d+\u0435\u0446\u044c-\u041f\u043e\u0434+\u0456\u043b\u044c\u0441\u044c\u043a\u0438\u0439 - \u043c+\u0456\u0441\u0442\u043e \u0432 \u0425\u043c\u0435\u043b\u044c\u043d+\u0438\u0446\u044c\u043a\u0456\u0439 +\u043e\u0431\u043b\u0430\u0441\u0442\u0456 \u0423\u043a\u0440\u0430+\u0457\u043d\u0438, \u0446+\u0435\u043d\u0442\u0440 \u041a\u0430\u043c'\u044f\u043d+\u0435\u0446\u044c-\u041f\u043e\u0434+\u0456\u043b\u044c\u0441\u044c\u043a\u043e\u0457 \u043c\u0456\u0441\u044c\u043a+\u043e\u0457 \u043e\u0431'+\u0454\u0434\u043d\u0430\u043d\u043e\u0457 \u0442\u0435\u0440\u0438\u0442\u043e\u0440\u0456+\u0430\u043b\u044c\u043d\u043e\u0457 \u0433\u0440\u043e\u043c+\u0430\u0434\u0438 +\u0456 \u041a\u0430\u043c'\u044f\u043d+\u0435\u0446\u044c-\u041f\u043e\u0434+\u0456\u043b\u044c\u0441\u044c\u043a\u043e\u0433\u043e \u0440\u0430\u0439+\u043e\u043d\u0443."
144
+ ]
145
  ],
146
+ "eval_split_max_size": null,
147
+ "eval_split_size": 0.01,
148
+ "use_speaker_weighted_sampler": false,
149
+ "speaker_weighted_sampler_alpha": 1.0,
150
+ "use_language_weighted_sampler": false,
151
+ "language_weighted_sampler_alpha": 1.0,
152
  "model_args": {
153
+ "num_chars": 83,
154
  "out_channels": 513,
155
+ "spec_segment_size": 32,
156
  "hidden_channels": 192,
157
  "hidden_channels_ffn_text_encoder": 768,
158
  "num_heads_text_encoder": 2,
 
214
  "use_speaker_embedding": false,
215
  "num_speakers": 0,
216
  "speakers_file": null,
217
+ "d_vector_file": null,
218
  "speaker_embedding_channels": 256,
219
  "use_d_vector_file": false,
 
220
  "d_vector_dim": 0,
221
+ "detach_dp_input": true,
222
+ "use_language_embedding": false,
223
+ "embedded_language_dim": 4,
224
+ "num_languages": 0,
225
+ "language_ids_file": null,
226
+ "use_speaker_encoder_as_loss": false,
227
+ "speaker_encoder_config_path": "",
228
+ "speaker_encoder_model_path": "",
229
+ "condition_dp_on_speaker": true,
230
+ "freeze_encoder": false,
231
+ "freeze_DP": false,
232
+ "freeze_PE": false,
233
+ "freeze_flow_decoder": false,
234
+ "freeze_waveform_decoder": false
235
  },
 
 
 
 
236
  "lr_gen": 0.0002,
237
  "lr_disc": 0.0002,
238
  "lr_scheduler_gen": "ExponentialLR",
 
251
  "feat_loss_alpha": 1.0,
252
  "mel_loss_alpha": 45.0,
253
  "dur_loss_alpha": 1.0,
254
+ "speaker_encoder_loss_alpha": 1.0,
255
  "return_wav": true,
256
  "r": 1,
257
  "num_speakers": 0,
258
  "use_speaker_embedding": false,
259
  "speakers_file": null,
260
  "speaker_embedding_channels": 256,
261
+ "language_ids_file": null,
262
+ "use_language_embedding": false,
263
  "use_d_vector_file": false,
264
  "d_vector_file": null,
265
+ "d_vector_dim": 0,
266
+ "restore_path": "./vits_mykyta-May-06-2022_12+17AM-c410bc58/best_model_90901.pth",
267
+ "github_branch": "* (HEAD detached at v0.6.2)"
268
  }
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
- TTS==0.4.1
2
  gradio
 
1
+ TTS==0.6.2
2
  gradio