barghavani commited on
Commit
78354af
1 Parent(s): bb898f9

Upload 5 files

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ trainer_0_log.txt filter=lfs diff=lfs merge=lfs -text
config (1).json ADDED
@@ -0,0 +1,274 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "output_path": "runs",
3
+ "logger_uri": null,
4
+ "run_name": "persian-tts-vits-grapheme-cv15-multispeaker-RERUN",
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
+ "save_on_interrupt": true,
13
+ "log_model_step": 1000,
14
+ "save_step": 1000,
15
+ "save_n_checkpoints": 5,
16
+ "save_checkpoints": true,
17
+ "save_all_best": false,
18
+ "save_best_after": 10000,
19
+ "target_loss": null,
20
+ "print_eval": true,
21
+ "test_delay_epochs": -1,
22
+ "run_eval": true,
23
+ "run_eval_steps": 1000,
24
+ "distributed_backend": "nccl",
25
+ "distributed_url": "tcp://localhost:54321",
26
+ "mixed_precision": false,
27
+ "precision": "fp16",
28
+ "epochs": 1000,
29
+ "batch_size": 8,
30
+ "eval_batch_size": 4,
31
+ "grad_clip": [
32
+ 1000,
33
+ 1000
34
+ ],
35
+ "scheduler_after_epoch": true,
36
+ "lr": 0.001,
37
+ "optimizer": "AdamW",
38
+ "optimizer_params": {
39
+ "betas": [
40
+ 0.8,
41
+ 0.99
42
+ ],
43
+ "eps": 1e-09,
44
+ "weight_decay": 0.01
45
+ },
46
+ "lr_scheduler": null,
47
+ "lr_scheduler_params": {},
48
+ "use_grad_scaler": false,
49
+ "allow_tf32": false,
50
+ "cudnn_enable": true,
51
+ "cudnn_deterministic": false,
52
+ "cudnn_benchmark": false,
53
+ "training_seed": 54321,
54
+ "model": "vits",
55
+ "num_loader_workers": 16,
56
+ "num_eval_loader_workers": 8,
57
+ "use_noise_augment": false,
58
+ "audio": {
59
+ "fft_size": 1024,
60
+ "sample_rate": 22050,
61
+ "win_length": 1024,
62
+ "hop_length": 256,
63
+ "num_mels": 80,
64
+ "mel_fmin": 0,
65
+ "mel_fmax": null
66
+ },
67
+ "use_phonemes": false,
68
+ "phonemizer": null,
69
+ "phoneme_language": null,
70
+ "compute_input_seq_cache": true,
71
+ "text_cleaner": "basic_cleaners",
72
+ "enable_eos_bos_chars": false,
73
+ "test_sentences_file": "",
74
+ "phoneme_cache_path": "cache/phoneme_cache_grapheme_azure-2",
75
+ "characters": {
76
+ "characters_class": "TTS.tts.models.vits.VitsCharacters",
77
+ "vocab_dict": null,
78
+ "pad": "<PAD>",
79
+ "eos": "<EOS>",
80
+ "bos": "<BOS>",
81
+ "blank": "<BLNK>",
82
+ "characters": "\u0621\u0627\u0628\u062a\u062b\u062c\u062d\u062e\u062f\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063a\u0641\u0642\u0644\u0645\u0646\u0647\u0648\u064a\u0650\u067e\u0686\u0698\u06a9\u06af\u06cc\u0622\u0623\u0624\u0625\u0626\u064b\u064e\u064f\u0651",
83
+ "punctuations": "!(),-.:;? \u0320\u060c\u061b\u061f\u200c<>\u066b",
84
+ "phonemes": "\u02c8\u02cc\u02d0\u02d1pbtd\u0288\u0256c\u025fk\u0261q\u0262\u0294\u0274\u014b\u0272\u0273n\u0271m\u0299r\u0280\u2c71\u027e\u027d\u0278\u03b2fv\u03b8\u00f0sz\u0283\u0292\u0282\u0290\u00e7\u029dx\u0263\u03c7\u0281\u0127\u0295h\u0266\u026c\u026e\u028b\u0279\u027bj\u0270l\u026d\u028e\u029faegiouwy\u026a\u028a\u0329\u00e6\u0251\u0254\u0259\u025a\u025b\u025d\u0268\u0303\u0289\u028c\u028d0123456789\"#$%*+/=ABCDEFGHIJKLMNOPRSTUVWXYZ[]^_{}\u06f1\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9\u06f0",
85
+ "is_unique": true,
86
+ "is_sorted": true
87
+ },
88
+ "add_blank": true,
89
+ "batch_group_size": 16,
90
+ "loss_masking": null,
91
+ "min_audio_len": 1,
92
+ "max_audio_len": Infinity,
93
+ "min_text_len": 1,
94
+ "max_text_len": Infinity,
95
+ "compute_f0": false,
96
+ "compute_energy": false,
97
+ "compute_linear_spec": true,
98
+ "precompute_num_workers": 0,
99
+ "start_by_longest": false,
100
+ "shuffle": false,
101
+ "drop_last": false,
102
+ "datasets": [
103
+ {
104
+ "formatter": "common_voice",
105
+ "dataset_name": "",
106
+ "path": "/home/bargh1/TTS/datasets",
107
+ "meta_file_train": "validated.tsv",
108
+ "ignored_speakers": null,
109
+ "language": "",
110
+ "phonemizer": "",
111
+ "meta_file_val": "",
112
+ "meta_file_attn_mask": ""
113
+ }
114
+ ],
115
+ "test_sentences": [
116
+ [
117
+ "\u0632\u06cc\u0646 \u0647\u0645\u0631\u0647\u0627\u0646 \u0633\u0633\u062a \u0639\u0646\u0627\u0635\u0631\u060c \u062f\u0644\u0645 \u06af\u0631\u0641\u062a."
118
+ ],
119
+ [
120
+ "\u0628\u06cc\u0627 \u062a\u0627 \u06af\u0644 \u0628\u0631\u0627\u0641\u0634\u0627\u0646\u06cc\u0645 \u0648 \u0645\u06cc \u062f\u0631 \u0633\u0627\u063a\u0631 \u0627\u0646\u062f\u0627\u0632\u06cc\u0645."
121
+ ],
122
+ [
123
+ "\u0628\u0646\u06cc \u0622\u062f\u0645 \u0627\u0639\u0636\u0627\u06cc \u06cc\u06a9 \u067e\u06cc\u06a9\u0631\u0646\u062f, \u06a9\u0647 \u062f\u0631 \u0622\u0641\u0631\u06cc\u0646\u0634 \u0632 \u06cc\u06a9 \u06af\u0648\u0647\u0631\u0646\u062f."
124
+ ],
125
+ [
126
+ "\u0633\u0647\u0627\u0645 \u0632\u0646\u062f\u06af\u06cc \u0628\u0647 10 \u062f\u0631\u0635\u062f \u0648 \u0633\u0647\u0627\u0645 \u0628\u06cc\u062a\u06a9\u0648\u06cc\u0646 \u06af\u0648\u06af\u0644 \u0628\u0647 33 \u062f\u0631\u0635\u062f \u0627\u0641\u0632\u0627\u06cc\u0634 \u06cc\u0627\u0641\u062a."
127
+ ],
128
+ [
129
+ "\u0645\u0646 \u0628\u0648\u062f\u0645 \u0648 \u0622\u0628\u062c\u06cc \u0641\u0648\u062a\u06cc\u0646\u0627\u060c \u0648 \u062d\u0627\u0644\u0627 \u0631\u067e\u062a\u06cc \u067e\u062a\u06cc\u0646\u0627. \u0627\u06cc\u0646 \u0634\u0639\u0631 \u06cc\u06a9\u06cc \u0627\u0632 \u0627\u0634\u0639\u0627\u0631 \u0645\u0639\u0631\u0648\u0641 \u0631\u0648 \u062d\u0648\u0636\u06cc \u0627\u0633\u062a \u06a9\u0647 \u062f\u0631 \u06a9\u0648\u0686\u0647 \u0628\u0627\u0632\u0627\u0631 \u062a\u0647\u0631\u0627\u0646 \u0632\u0645\u0632\u0645\u0647 \u0645\u06cc \u0634\u062f\u0647 \u0627\u0633\u062a."
130
+ ],
131
+ [
132
+ "\u06cc\u0647 \u062f\u0648 \u062f\u0642\u0647 \u0647\u0645 \u0628\u0647 \u062d\u0631\u0641\u0645 \u06af\u0648\u0634 \u06a9\u0646\u060c \u0646\u06af\u0648 \u0646\u06af\u0648\u0634\u06cc\u062f\u0645 \u0648 \u0646\u062d\u0631\u0641\u06cc\u062f\u06cc."
133
+ ],
134
+ [
135
+ "\u062f\u0627\u0633\u062a\u0627\u0646 \u0628\u0627 \u062a\u0648\u0635\u06cc\u0641 \u0637\u0648\u0641\u0627\u0646\u200c\u0647\u0627\u06cc \u0634\u062f\u06cc\u062f \u0622\u063a\u0627\u0632 \u0645\u06cc\u200c\u0634\u0648\u062f\u061b \u0637\u0648\u0641\u0627\u0646\u200c\u0647\u0627\u06cc\u06cc \u06a9\u0647 \u0645\u0632\u0631\u0639\u0647\u200c\u0647\u0627 \u0631\u0627 \u0627\u0632 \u0628\u06cc\u0646 \u0645\u06cc\u200c\u0628\u0631\u062f \u0648 \u0645\u062d\u0635\u0648\u0644\u0627\u062a \u0631\u0627 \u0632\u06cc\u0631 \u0634\u0646 \u062f\u0641\u0646 \u0645\u06cc\u200c\u06a9\u0646\u062f\u061b \u0645\u062d\u0635\u0648\u0644\u0627\u062a\u06cc \u06a9\u0647 \u0632\u0646\u062f\u06af\u06cc \u0627\u0641\u0631\u0627\u062f \u0628\u0633\u06cc\u0627\u0631\u06cc \u0628\u0647 \u0622\u0646 \u0648\u0627\u0628\u0633\u062a\u0647 \u0627\u0633\u062a."
136
+ ]
137
+ ],
138
+ "eval_split_max_size": null,
139
+ "eval_split_size": 0.01,
140
+ "use_speaker_weighted_sampler": false,
141
+ "speaker_weighted_sampler_alpha": 1.0,
142
+ "use_language_weighted_sampler": false,
143
+ "language_weighted_sampler_alpha": 1.0,
144
+ "use_length_weighted_sampler": false,
145
+ "length_weighted_sampler_alpha": 1.0,
146
+ "model_args": {
147
+ "num_chars": 209,
148
+ "out_channels": 513,
149
+ "spec_segment_size": 32,
150
+ "hidden_channels": 192,
151
+ "hidden_channels_ffn_text_encoder": 768,
152
+ "num_heads_text_encoder": 2,
153
+ "num_layers_text_encoder": 6,
154
+ "kernel_size_text_encoder": 3,
155
+ "dropout_p_text_encoder": 0.1,
156
+ "dropout_p_duration_predictor": 0.5,
157
+ "kernel_size_posterior_encoder": 5,
158
+ "dilation_rate_posterior_encoder": 1,
159
+ "num_layers_posterior_encoder": 16,
160
+ "kernel_size_flow": 5,
161
+ "dilation_rate_flow": 1,
162
+ "num_layers_flow": 4,
163
+ "resblock_type_decoder": "1",
164
+ "resblock_kernel_sizes_decoder": [
165
+ 3,
166
+ 7,
167
+ 11
168
+ ],
169
+ "resblock_dilation_sizes_decoder": [
170
+ [
171
+ 1,
172
+ 3,
173
+ 5
174
+ ],
175
+ [
176
+ 1,
177
+ 3,
178
+ 5
179
+ ],
180
+ [
181
+ 1,
182
+ 3,
183
+ 5
184
+ ]
185
+ ],
186
+ "upsample_rates_decoder": [
187
+ 8,
188
+ 8,
189
+ 2,
190
+ 2
191
+ ],
192
+ "upsample_initial_channel_decoder": 512,
193
+ "upsample_kernel_sizes_decoder": [
194
+ 16,
195
+ 16,
196
+ 4,
197
+ 4
198
+ ],
199
+ "periods_multi_period_discriminator": [
200
+ 2,
201
+ 3,
202
+ 5,
203
+ 7,
204
+ 11
205
+ ],
206
+ "use_sdp": false,
207
+ "noise_scale": 1.0,
208
+ "inference_noise_scale": 0.667,
209
+ "length_scale": 1,
210
+ "noise_scale_dp": 1.0,
211
+ "inference_noise_scale_dp": 1.0,
212
+ "max_inference_len": null,
213
+ "init_discriminator": true,
214
+ "use_spectral_norm_disriminator": false,
215
+ "use_speaker_embedding": true,
216
+ "num_speakers": 0,
217
+ "speakers_file": "runs/persian-tts-vits-grapheme-cv15-multispeaker-RERUN-October-24-2023_05+57PM-1e152692/speakers.pth",
218
+ "d_vector_file": null,
219
+ "speaker_embedding_channels": 256,
220
+ "use_d_vector_file": false,
221
+ "d_vector_dim": 0,
222
+ "detach_dp_input": true,
223
+ "use_language_embedding": false,
224
+ "embedded_language_dim": 4,
225
+ "num_languages": 0,
226
+ "language_ids_file": null,
227
+ "use_speaker_encoder_as_loss": false,
228
+ "speaker_encoder_config_path": "",
229
+ "speaker_encoder_model_path": "",
230
+ "condition_dp_on_speaker": true,
231
+ "freeze_encoder": false,
232
+ "freeze_DP": false,
233
+ "freeze_PE": false,
234
+ "freeze_flow_decoder": false,
235
+ "freeze_waveform_decoder": false,
236
+ "encoder_sample_rate": null,
237
+ "interpolate_z": true,
238
+ "reinit_DP": false,
239
+ "reinit_text_encoder": false
240
+ },
241
+ "lr_gen": 0.0002,
242
+ "lr_disc": 0.0002,
243
+ "lr_scheduler_gen": "ExponentialLR",
244
+ "lr_scheduler_gen_params": {
245
+ "gamma": 0.999875,
246
+ "last_epoch": -1
247
+ },
248
+ "lr_scheduler_disc": "ExponentialLR",
249
+ "lr_scheduler_disc_params": {
250
+ "gamma": 0.999875,
251
+ "last_epoch": -1
252
+ },
253
+ "kl_loss_alpha": 1.0,
254
+ "disc_loss_alpha": 1.0,
255
+ "gen_loss_alpha": 1.0,
256
+ "feat_loss_alpha": 1.0,
257
+ "mel_loss_alpha": 45.0,
258
+ "dur_loss_alpha": 1.0,
259
+ "speaker_encoder_loss_alpha": 1.0,
260
+ "return_wav": true,
261
+ "use_weighted_sampler": false,
262
+ "weighted_sampler_attrs": {},
263
+ "weighted_sampler_multipliers": {},
264
+ "r": 1,
265
+ "num_speakers": 4104,
266
+ "use_speaker_embedding": true,
267
+ "speakers_file": "runs/persian-tts-vits-grapheme-cv15-multispeaker-RERUN-October-24-2023_05+57PM-1e152692/speakers.pth",
268
+ "speaker_embedding_channels": 256,
269
+ "language_ids_file": null,
270
+ "use_language_embedding": false,
271
+ "use_d_vector_file": false,
272
+ "d_vector_file": null,
273
+ "d_vector_dim": 0
274
+ }
events.out.tfevents.1698184620.lambda-01.3871.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b1f78da676999e96c7098e465bbd5ab9ba2056b13a489dcf8180ed11fd47ff7
3
+ size 192447983
multi-speaker (2).py ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ # os.environ["CUDA_VISIBLE_DEVICES"] = "7"
3
+
4
+
5
+ from trainer import Trainer, TrainerArgs
6
+
7
+ from TTS.tts.configs.shared_configs import BaseDatasetConfig , CharactersConfig
8
+ from TTS.config.shared_configs import BaseAudioConfig
9
+ from TTS.tts.configs.vits_config import VitsConfig
10
+ from TTS.tts.datasets import load_tts_samples
11
+ from TTS.tts.models.vits import Vits, VitsAudioConfig, VitsArgs
12
+ from TTS.tts.utils.text.tokenizer import TTSTokenizer
13
+ from TTS.utils.audio import AudioProcessor
14
+ from TTS.tts.utils.speakers import SpeakerManager
15
+
16
+ #import wandb
17
+ # Start a wandb run with `sync_tensorboard=True`
18
+ #if wandb.run is None:
19
+ #wandb.init(project="persian-tts-vits-grapheme-cv15-fa-male-native-multispeaker-RERUN", group="GPUx8 accel mixed bf16 128x32", sync_tensorboard=True)
20
+
21
+ # output_path = os.path.dirname(os.path.abspath(__file__))
22
+ # output_path = output_path + '/notebook_files/runs'
23
+ # output_path = wandb.run.dir ### PROBABLY better for notebook
24
+ output_path = "runs"
25
+
26
+ # print("output path is:")
27
+ # print(output_path)
28
+
29
+ cache_path = "cache"
30
+
31
+
32
+
33
+ # def mozilla(root_path, meta_file, **kwargs): # pylint: disable=unused-argument
34
+ # """Normalizes Mozilla meta data files to TTS format"""
35
+ # txt_file = os.path.join(root_path, meta_file)
36
+ # items = []
37
+ # # speaker_name = "mozilla"
38
+ # with open(txt_file, "r", encoding="utf-8") as ttf:
39
+ # for line in ttf:
40
+ # cols = line.split("|")
41
+ # wav_file = cols[1].strip()
42
+ # text = cols[0].strip()
43
+ # speaker_name = cols[2].strip()
44
+ # wav_file = os.path.join(root_path, "wavs", wav_file)
45
+ # items.append({"text": text, "audio_file": wav_file, "speaker_name": speaker_name, "root_path": root_path})
46
+ # return items
47
+
48
+
49
+
50
+ dataset_config = BaseDatasetConfig(
51
+ formatter='common_voice', meta_file_train='validated.tsv', path="/home/bargh1/TTS/datasets"
52
+ )
53
+
54
+
55
+
56
+
57
+ character_config=CharactersConfig(
58
+ characters='ءابتثجحخدذرزسشصضطظعغفقلمنهويِپچژکگیآأؤإئًَُّ',
59
+ # characters="!¡'(),-.:;¿?ABCDEFGHIJKLMNOPRSTUVWXYZabcdefghijklmnopqrstuvwxyzáçèéêëìíîïñòóôöùúûü«°±µ»$%&‘’‚“`”„",
60
+ punctuations='!(),-.:;? ̠،؛؟‌<>٫',
61
+ phonemes='ˈˌːˑpbtdʈɖcɟkɡqɢʔɴŋɲɳnɱmʙrʀⱱɾɽɸβfvθðszʃʒʂʐçʝxɣχʁħʕhɦɬɮʋɹɻjɰlɭʎʟaegiouwyɪʊ̩æɑɔəɚɛɝɨ̃ʉʌʍ0123456789"#$%*+/=ABCDEFGHIJKLMNOPRSTUVWXYZ[]^_{}۱۲۳۴۵۶۷۸۹۰',
62
+ pad="<PAD>",
63
+ eos="<EOS>",
64
+ bos="<BOS>",
65
+ blank="<BLNK>",
66
+ characters_class="TTS.tts.models.vits.VitsCharacters",
67
+ )
68
+
69
+ # From the coqui multilinguL recipes, will try later
70
+ vitsArgs = VitsArgs(
71
+ # use_language_embedding=True,
72
+ # embedded_language_dim=1,
73
+ use_speaker_embedding=True,
74
+ use_sdp=False,
75
+ )
76
+
77
+ audio_config = BaseAudioConfig(
78
+ sample_rate=22050,
79
+ do_trim_silence=True,
80
+ min_level_db=-1,
81
+ # do_sound_norm=True,
82
+ signal_norm=True,
83
+ clip_norm=True,
84
+ symmetric_norm=True,
85
+ max_norm = 0.9,
86
+ resample=True,
87
+ win_length=1024,
88
+ hop_length=256,
89
+ num_mels=80,
90
+ mel_fmin=0,
91
+ mel_fmax=None
92
+ )
93
+
94
+ vits_audio_config = VitsAudioConfig(
95
+ sample_rate=22050,
96
+ # do_sound_norm=True,
97
+ win_length=1024,
98
+ hop_length=256,
99
+ num_mels=80,
100
+ # do_trim_silence=True, #from hugging
101
+ mel_fmin=0,
102
+ mel_fmax=None
103
+ )
104
+ config = VitsConfig(
105
+ model_args=vitsArgs,
106
+ audio=vits_audio_config, #from huggingface
107
+ run_name="persian-tts-vits-grapheme-cv15-multispeaker-RERUN",
108
+ use_speaker_embedding=True, ## For MULTI SPEAKER
109
+ batch_size=8,
110
+ batch_group_size=16,
111
+ eval_batch_size=4,
112
+ num_loader_workers=16,
113
+ num_eval_loader_workers=8,
114
+ run_eval=True,
115
+ run_eval_steps = 1000,
116
+ print_eval=True,
117
+ test_delay_epochs=-1,
118
+ epochs=1000,
119
+ save_step=1000,
120
+ text_cleaner="basic_cleaners", #from MH
121
+ use_phonemes=False,
122
+ # phonemizer='persian_mh', #from TTS github
123
+ # phoneme_language="fa",
124
+ characters=character_config, #test without as well
125
+ phoneme_cache_path=os.path.join(cache_path, "phoneme_cache_grapheme_azure-2"),
126
+ compute_input_seq_cache=True,
127
+ print_step=25,
128
+ mixed_precision=False, #from TTS - True causes error "Expected reduction dim"
129
+ test_sentences=[
130
+ ["زین همرهان سست عناصر، دلم گرفت."],
131
+ ["بیا تا گل برافشانیم و می در ساغر اندازیم."],
132
+ ["بنی آدم اعضای یک پیکرند, که در آفرینش ز یک گوهرند."],
133
+ ["سهام زندگی به 10 درصد و سهام بیتکوین گوگل به 33 درصد افزایش یافت."],
134
+ ["من بودم و آبجی فوتینا، و حالا رپتی پتینا. این شعر یکی از اشعار معروف رو حوضی است که در کوچه بازار تهران زمزمه می شده است." ],
135
+ ["یه دو دقه هم به حرفم گوش کن، نگو نگوشیدم و نحرفیدی."],
136
+ [ "داستان با توصیف طوفان‌های شدید آغاز می‌شود؛ طوفان‌هایی که مزرعه‌ها را از بین می‌برد و محصولات را زیر شن دفن می‌کند؛ محصولاتی که زندگی افراد بسیاری به آن وابسته است."]
137
+ ],
138
+ output_path=output_path,
139
+ datasets=[dataset_config]
140
+ )
141
+
142
+ # INITIALIZE THE AUDIO PROCESSOR
143
+ # Audio processor is used for feature extraction and audio I/O.
144
+ # It mainly serves to the dataloader and the training loggers.
145
+ ap = AudioProcessor.init_from_config(config)
146
+
147
+ # INITIALIZE THE TOKENIZER
148
+ # Tokenizer is used to convert text to sequences of token IDs.
149
+ # config is updated with the default characters if not defined in the config.
150
+ tokenizer, config = TTSTokenizer.init_from_config(config)
151
+
152
+ # LOAD DATA SAMPLES
153
+ # Each sample is a list of ```[text, audio_file_path, speaker_name]```
154
+ # You can define your custom sample loader returning the list of samples.
155
+ # Or define your custom formatter and pass it to the `load_tts_samples`.
156
+ # Check `TTS.tts.datasets.load_tts_samples` for more details.
157
+ train_samples, eval_samples = load_tts_samples(
158
+ dataset_config,
159
+ eval_split=True,
160
+ eval_split_max_size=config.eval_split_max_size,
161
+ eval_split_size=config.eval_split_size,
162
+ )
163
+
164
+ # init speaker manager for multi-speaker training
165
+ # it maps speaker-id to speaker-name in the model and data-loader
166
+ speaker_manager = SpeakerManager()
167
+ speaker_manager.set_ids_from_data(train_samples + eval_samples, parse_key="speaker_name")
168
+ config.num_speakers = speaker_manager.num_speakers
169
+
170
+
171
+
172
+ # init model
173
+ model = Vits(config, ap, tokenizer, speaker_manager=speaker_manager)
174
+
175
+ # init the trainer and 🚀
176
+
177
+ trainer = Trainer(
178
+ TrainerArgs(use_accelerate=True),
179
+ config,
180
+ output_path,
181
+ model=model,
182
+ train_samples=train_samples,
183
+ eval_samples=eval_samples,
184
+ )
185
+ trainer.fit()
speakers (2).pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:97f03df7324dddf744a9dadd9d37aea81b2cc2f6e20861593ff7b0e22cffc866
3
+ size 594912
trainer_0_log.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62bf44eb1675ddea006da62ff71a8e1692c6c7ea0329f57ea0da96a336d1e444
3
+ size 268558421