samikhan121 commited on
Commit
842792e
1 Parent(s): 8d57186

Add model checkpoint

Browse files
best_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7cf932ed3bba5a553960e51053406660f48ffccea9e2d399a1e75f13a68eab2d
3
+ size 1038567590
best_model_22458.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7cf932ed3bba5a553960e51053406660f48ffccea9e2d399a1e75f13a68eab2d
3
+ size 1038567590
checkpoint_20000.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a4910a666bdb5f46e370448673a491ee6acb681935ec9611c5c6090b152dd93b
3
+ size 1038567590
checkpoint_25000.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:111ecf522d83593fa3500550deaf8142c11160d5442c4a295e2c61c7c0df88cb
3
+ size 1038567590
checkpoint_30000.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c27b6cabed0d094cbb08edc20d36b6f331cf7ffc1703665cb7e96f37457df972
3
+ size 1038567590
checkpoint_35000.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0e8b556152cb0ec34fd483306b402cf9ac1b581b638d41afe206fa2187da8e06
3
+ size 1038567590
config.json ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "output_path": "/home/ubuntu/vits-train",
3
+ "logger_uri": null,
4
+ "run_name": "vits_nctb",
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": 5000,
14
+ "save_step": 5000,
15
+ "save_n_checkpoints": 5,
16
+ "save_checkpoints": true,
17
+ "save_all_best": false,
18
+ "save_best_after": 0,
19
+ "target_loss": null,
20
+ "print_eval": false,
21
+ "test_delay_epochs": -1,
22
+ "run_eval": true,
23
+ "run_eval_steps": null,
24
+ "distributed_backend": "nccl",
25
+ "distributed_url": "tcp://localhost:54321",
26
+ "mixed_precision": true,
27
+ "precision": "fp16",
28
+ "epochs": 1000,
29
+ "batch_size": 64,
30
+ "eval_batch_size": 8,
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": true,
53
+ "training_seed": 54321,
54
+ "model": "vits",
55
+ "num_loader_workers": 4,
56
+ "num_eval_loader_workers": 4,
57
+ "use_noise_augment": false,
58
+ "audio": {
59
+ "fft_size": 1024,
60
+ "sample_rate": 16000,
61
+ "win_length": 1024,
62
+ "hop_length": 256,
63
+ "num_mels": 80,
64
+ "mel_fmin": 0,
65
+ "mel_fmax": null
66
+ },
67
+ "use_phonemes": true,
68
+ "phonemizer": "bn_phonemizer",
69
+ "phoneme_language": "bn",
70
+ "compute_input_seq_cache": true,
71
+ "text_cleaner": "phoneme_cleaners",
72
+ "enable_eos_bos_chars": false,
73
+ "test_sentences_file": "",
74
+ "phoneme_cache_path": "/home/ubuntu/vits-train/phoneme_cache",
75
+ "characters": {
76
+ "characters_class": "TTS.tts.utils.text.characters.IPAPhonemes",
77
+ "vocab_dict": null,
78
+ "pad": "<PAD>",
79
+ "eos": "<EOS>",
80
+ "bos": "<BOS>",
81
+ "blank": "<BLNK>",
82
+ "characters": "abcdefghijklmnopqrstuvwxyz0123456789+=/*\u221a\u09a4\u099f\u09eb\u09ad\u09bf\u0990\u098b\u0996\u098a\u09dc\u0987\u099c\u09ae\u098f\u09c7\u0998\u0999\u09b8\u09c0\u09dd\u09b9\u099e\u2018\u0988\u0995\u09a3\u09ec\u0981\u09d7\u09b6\u09a2\u09a0\u200c\u09e7\u09cd\u09e8\u09ee\u09a6\u09c3\u0994\u0997\u0993\u2014\u099b\u0989\u0982\u09ac\u09c8\u099d\u09be\u09af\u09ab\u200d\u099a\u09b0\u09b7\u0985\u09cc\u09ce\u09a5\u09a1\u09bc\u09ea\u09a7\u09e6\u09c1\u09c2\u09e9\u0986\u0983\u09aa\u09df\u2019'\u201d\u09a8\u09b2\u09cb_\u2026\u09f0",
83
+ "punctuations": "-\u2013:;!,|.?\u0965\u0964 \u201c",
84
+ "phonemes": null,
85
+ "is_unique": true,
86
+ "is_sorted": true
87
+ },
88
+ "add_blank": true,
89
+ "batch_group_size": 5,
90
+ "loss_masking": null,
91
+ "min_audio_len": 1,
92
+ "max_audio_len": Infinity,
93
+ "min_text_len": 1,
94
+ "max_text_len": 325,
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": "",
105
+ "dataset_name": "",
106
+ "path": "/home/ubuntu/nctb-cropped/",
107
+ "meta_file_train": "/home/ubuntu/nctb-cropped/metadata.txt",
108
+ "ignored_speakers": null,
109
+ "language": "bn",
110
+ "phonemizer": "",
111
+ "meta_file_val": "",
112
+ "meta_file_attn_mask": ""
113
+ }
114
+ ],
115
+ "test_sentences": [
116
+ "\u0986\u09ae\u09be\u09b0 \u09b8\u09cb\u09a8\u09be\u09b0 \u09ac\u09be\u0982\u09b2\u09be, \u0986\u09ae\u09bf \u09a4\u09cb\u09ae\u09be\u09df \u09ad\u09be\u09b2\u09cb\u09ac\u09be\u09b8\u09bf\u0964",
117
+ "\u099a\u09bf\u09b0\u09a6\u09bf\u09a8 \u09a4\u09cb\u09ae\u09be\u09b0 \u0986\u0995\u09be\u09b6, \u09a4\u09cb\u09ae\u09be\u09b0 \u09ac\u09be\u09a4\u09be\u09b8, \u0986\u09ae\u09be\u09b0 \u09aa\u09cd\u09b0\u09be\u09a3\u09c7 \u09ac\u09be\u099c\u09be\u09df \u09ac\u09be\u0981\u09b6\u09bf",
118
+ "\u0993 \u09ae\u09be, \u09ab\u09be\u0997\u09c1\u09a8\u09c7 \u09a4\u09cb\u09b0 \u0986\u09ae\u09c7\u09b0 \u09ac\u09a8\u09c7 \u0998\u09cd\u09b0\u09be\u09a3\u09c7 \u09aa\u09be\u0997\u09b2 \u0995\u09b0\u09c7,\u09ae\u09b0\u09bf \u09b9\u09be\u09df, \u09b9\u09be\u09df \u09b0\u09c7\u0964"
119
+ ],
120
+ "eval_split_max_size": null,
121
+ "eval_split_size": 0.01,
122
+ "use_speaker_weighted_sampler": false,
123
+ "speaker_weighted_sampler_alpha": 1.0,
124
+ "use_language_weighted_sampler": false,
125
+ "language_weighted_sampler_alpha": 1.0,
126
+ "use_length_weighted_sampler": false,
127
+ "length_weighted_sampler_alpha": 1.0,
128
+ "model_args": {
129
+ "num_chars": 139,
130
+ "out_channels": 513,
131
+ "spec_segment_size": 32,
132
+ "hidden_channels": 192,
133
+ "hidden_channels_ffn_text_encoder": 768,
134
+ "num_heads_text_encoder": 2,
135
+ "num_layers_text_encoder": 6,
136
+ "kernel_size_text_encoder": 3,
137
+ "dropout_p_text_encoder": 0.1,
138
+ "dropout_p_duration_predictor": 0.5,
139
+ "kernel_size_posterior_encoder": 5,
140
+ "dilation_rate_posterior_encoder": 1,
141
+ "num_layers_posterior_encoder": 16,
142
+ "kernel_size_flow": 5,
143
+ "dilation_rate_flow": 1,
144
+ "num_layers_flow": 4,
145
+ "resblock_type_decoder": "1",
146
+ "resblock_kernel_sizes_decoder": [
147
+ 3,
148
+ 7,
149
+ 11
150
+ ],
151
+ "resblock_dilation_sizes_decoder": [
152
+ [
153
+ 1,
154
+ 3,
155
+ 5
156
+ ],
157
+ [
158
+ 1,
159
+ 3,
160
+ 5
161
+ ],
162
+ [
163
+ 1,
164
+ 3,
165
+ 5
166
+ ]
167
+ ],
168
+ "upsample_rates_decoder": [
169
+ 8,
170
+ 8,
171
+ 2,
172
+ 2
173
+ ],
174
+ "upsample_initial_channel_decoder": 512,
175
+ "upsample_kernel_sizes_decoder": [
176
+ 16,
177
+ 16,
178
+ 4,
179
+ 4
180
+ ],
181
+ "periods_multi_period_discriminator": [
182
+ 2,
183
+ 3,
184
+ 5,
185
+ 7,
186
+ 11
187
+ ],
188
+ "use_sdp": true,
189
+ "noise_scale": 1.0,
190
+ "inference_noise_scale": 0.667,
191
+ "length_scale": 1,
192
+ "noise_scale_dp": 1.0,
193
+ "inference_noise_scale_dp": 1.0,
194
+ "max_inference_len": null,
195
+ "init_discriminator": true,
196
+ "use_spectral_norm_disriminator": false,
197
+ "use_speaker_embedding": true,
198
+ "num_speakers": 126,
199
+ "speakers_file": "/home/ubuntu/vits-train/vits_nctb-June-25-2024_02+44AM-0000000/speakers.pth",
200
+ "d_vector_file": null,
201
+ "speaker_embedding_channels": 256,
202
+ "use_d_vector_file": false,
203
+ "d_vector_dim": 0,
204
+ "detach_dp_input": true,
205
+ "use_language_embedding": false,
206
+ "embedded_language_dim": 4,
207
+ "num_languages": 0,
208
+ "language_ids_file": null,
209
+ "use_speaker_encoder_as_loss": false,
210
+ "speaker_encoder_config_path": "",
211
+ "speaker_encoder_model_path": "",
212
+ "condition_dp_on_speaker": true,
213
+ "freeze_encoder": false,
214
+ "freeze_DP": false,
215
+ "freeze_PE": false,
216
+ "freeze_flow_decoder": false,
217
+ "freeze_waveform_decoder": false,
218
+ "encoder_sample_rate": null,
219
+ "interpolate_z": true,
220
+ "reinit_DP": false,
221
+ "reinit_text_encoder": false
222
+ },
223
+ "lr_gen": 0.0002,
224
+ "lr_disc": 0.0002,
225
+ "lr_scheduler_gen": "ExponentialLR",
226
+ "lr_scheduler_gen_params": {
227
+ "gamma": 0.999875,
228
+ "last_epoch": -1
229
+ },
230
+ "lr_scheduler_disc": "ExponentialLR",
231
+ "lr_scheduler_disc_params": {
232
+ "gamma": 0.999875,
233
+ "last_epoch": -1
234
+ },
235
+ "kl_loss_alpha": 1.0,
236
+ "disc_loss_alpha": 1.0,
237
+ "gen_loss_alpha": 1.0,
238
+ "feat_loss_alpha": 1.0,
239
+ "mel_loss_alpha": 45.0,
240
+ "dur_loss_alpha": 1.0,
241
+ "speaker_encoder_loss_alpha": 1.0,
242
+ "return_wav": true,
243
+ "use_weighted_sampler": false,
244
+ "weighted_sampler_attrs": {},
245
+ "weighted_sampler_multipliers": {},
246
+ "r": 1,
247
+ "num_speakers": 0,
248
+ "use_speaker_embedding": true,
249
+ "speakers_file": "/home/ubuntu/vits-train/vits_nctb-June-25-2024_02+44AM-0000000/speakers.pth",
250
+ "speaker_embedding_channels": 256,
251
+ "language_ids_file": null,
252
+ "use_language_embedding": false,
253
+ "use_d_vector_file": false,
254
+ "d_vector_file": null,
255
+ "d_vector_dim": 0
256
+ }
events.out.tfevents.1719283482.ip-172-31-47-220.253748.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ce272de8ebef3c36b93a7e934e0c7ad00cb9ef9402d176d1ad8125e93d763697
3
+ size 52008599
speakers.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a51f7805073ce561b112b7097cdb1fe1bc8382c92c34637f50a15a2e644f8a32
3
+ size 2528
train_vits.py ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ from trainer import Trainer, TrainerArgs
4
+
5
+ from TTS.tts.configs.shared_configs import BaseDatasetConfig, CharactersConfig
6
+ from TTS.tts.configs.vits_config import VitsConfig
7
+ from TTS.tts.datasets import load_tts_samples
8
+ from TTS.tts.models.vits import Vits, VitsArgs, VitsAudioConfig
9
+ from TTS.tts.utils.speakers import SpeakerManager
10
+ from TTS.tts.utils.text.tokenizer import TTSTokenizer
11
+ from TTS.utils.audio import AudioProcessor
12
+
13
+ output_path = os.path.dirname(os.path.abspath(__file__))
14
+ # dataset_config = BaseDatasetConfig(
15
+ # formatter="vctk", meta_file_train="", language="en-us", path=os.path.join(output_path, "../VCTK/")
16
+ # )
17
+
18
+ CONTINUE_PATH=None
19
+ RESTORE_PATH=None
20
+ START_WITH_EVAL=True
21
+ GRAD_ACUMM_STEPS=1
22
+
23
+ meta_file = '/home/ubuntu/nctb-cropped/metadata.txt'
24
+ root_path = '/home/ubuntu/nctb-cropped/'
25
+
26
+ def formatter(root_path, meta_file, **kwargs): # pylint: disable=unused-argument
27
+ """Normalizes the LJSpeech meta data file to TTS format
28
+ https://keithito.com/LJ-Speech-Dataset/"""
29
+ txt_file = meta_file
30
+ items = []
31
+ with open(txt_file, "r", encoding="utf-8") as ttf:
32
+ for line in ttf:
33
+ cols = line.split("|")
34
+ wav_file = os.path.join(root_path,'audio', cols[0])
35
+ speaker_name = cols[0].split('_')[-1].split('.')[0]
36
+ try:
37
+ text = cols[1]
38
+ except:
39
+ print("not found")
40
+
41
+ items.append({"text": text, "audio_file": wav_file, "speaker_name": speaker_name, "root_path": root_path})
42
+ return items
43
+
44
+
45
+ dataset_config = BaseDatasetConfig(
46
+ meta_file_train=meta_file, path=os.path.join(root_path, ""), language="bn"
47
+ )
48
+
49
+
50
+ characters_config = CharactersConfig(
51
+ pad = '<PAD>',
52
+ eos = '<EOS>', #'<EOS>', #'।',
53
+ bos = '<BOS>',# None,
54
+ blank = '<BLNK>',
55
+ phonemes = None,
56
+ characters = "abcdefghijklmnopqrstuvwxyz0123456789+=/*√তট৫ভিঐঋখঊড়ইজমএেঘঙসীঢ়হঞ‘ঈকণ৬ঁৗশঢঠ\u200c১্২৮দৃঔগও—ছউংবৈঝাযফ\u200dচরষঅৌৎথড়৪ধ০ুূ৩আঃপয়’'”নলো_…ৰ",
57
+ punctuations = "-–:;!,|.?॥। “",
58
+ )
59
+
60
+
61
+ audio_config = VitsAudioConfig(
62
+ sample_rate=16000, win_length=1024, hop_length=256, num_mels=80, mel_fmin=0, mel_fmax=None
63
+ )
64
+
65
+ vitsArgs = VitsArgs(
66
+ use_speaker_embedding=True,
67
+ )
68
+
69
+ config = VitsConfig(
70
+ model_args=vitsArgs,
71
+ audio=audio_config,
72
+ run_name="vits_nctb",
73
+ batch_size=64,
74
+ eval_batch_size=8,
75
+ batch_group_size=5,
76
+ num_loader_workers=4,
77
+ num_eval_loader_workers=4,
78
+ run_eval=True,
79
+ test_delay_epochs=-1,
80
+ epochs=1000,
81
+ # text_cleaner="english_cleaners",
82
+ text_cleaner='phoneme_cleaners',
83
+ use_phonemes=True,
84
+ phoneme_language="bn",
85
+ phoneme_cache_path=os.path.join(output_path, "phoneme_cache"),
86
+ compute_input_seq_cache=True,
87
+ print_step=25,
88
+ print_eval=False,
89
+ mixed_precision=True,
90
+ max_text_len=325, # change this if you have a larger VRAM than 16GB
91
+ output_path=output_path,
92
+ datasets=[dataset_config],
93
+ characters=characters_config,
94
+ save_step=5000,
95
+ cudnn_benchmark=True,
96
+ test_sentences = [
97
+ 'আমার সোনার বাংলা, আমি তোমায় ভালোবাসি।',
98
+ 'চিরদিন তোমার আকাশ, তোমার বাতাস, আমার প্রাণে বাজায় বাঁশি',
99
+ 'ও মা, ফাগুনে তোর আমের বনে ঘ্রাণে পাগল করে,মরি হায়, হায় রে।'
100
+ ]
101
+ )
102
+
103
+ # INITIALIZE THE AUDIO PROCESSOR
104
+ # Audio processor is used for feature extraction and audio I/O.
105
+ # It mainly serves to the dataloader and the training loggers.
106
+ ap = AudioProcessor.init_from_config(config)
107
+
108
+ # INITIALIZE THE TOKENIZER
109
+ # Tokenizer is used to convert text to sequences of token IDs.
110
+ # config is updated with the default characters if not defined in the config.
111
+ tokenizer, config = TTSTokenizer.init_from_config(config)
112
+
113
+ # LOAD DATA SAMPLES
114
+ # Each sample is a list of ```[text, audio_file_path, speaker_name]```
115
+ # You can define your custom sample loader returning the list of samples.
116
+ # Or define your custom formatter and pass it to the `load_tts_samples`.
117
+ # Check `TTS.tts.datasets.load_tts_samples` for more details.
118
+ train_samples, eval_samples = load_tts_samples(
119
+ dataset_config,
120
+ formatter=formatter,
121
+ eval_split=True,
122
+ eval_split_max_size=config.eval_split_max_size,
123
+ eval_split_size=config.eval_split_size,
124
+ )
125
+
126
+ # init speaker manager for multi-speaker training
127
+ # it maps speaker-id to speaker-name in the model and data-loader
128
+ speaker_manager = SpeakerManager()
129
+ speaker_manager.set_ids_from_data(train_samples + eval_samples, parse_key="speaker_name")
130
+ config.model_args.num_speakers = speaker_manager.num_speakers
131
+
132
+ # init model
133
+ model = Vits(config, ap, tokenizer, speaker_manager)
134
+
135
+ # init the trainer and 🚀
136
+ trainer = Trainer(
137
+ TrainerArgs(
138
+ continue_path=CONTINUE_PATH,
139
+ restore_path=RESTORE_PATH,
140
+ skip_train_epoch=False,
141
+ start_with_eval=START_WITH_EVAL,
142
+ grad_accum_steps=GRAD_ACUMM_STEPS,
143
+ ),
144
+ config,
145
+ output_path,
146
+ model=model,
147
+ train_samples=train_samples,
148
+ eval_samples=eval_samples,
149
+ )
150
+ trainer.fit()
trainer_0_log.txt ADDED
The diff for this file is too large to render. See raw diff