SpireLab commited on
Commit
b9102cf
·
verified ·
1 Parent(s): e068ad2

Upload 21 files

Browse files
README.md ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - saz
4
+ - ta
5
+ license: cc-by-4.0
6
+ tags:
7
+ - text-to-speech
8
+ - tts
9
+ - vits
10
+ - sourashtra
11
+ - low-resource
12
+ pipeline_tag: text-to-speech
13
+ ---
14
+
15
+ # Sourashtra VITS TTS Models
16
+
17
+ VITS text-to-speech models for the [Sourashtra language](https://en.wikipedia.org/wiki/Sourashtra_language) (ISO 639-3: `saz`), a minority Indo-Aryan language spoken primarily in Tamil Nadu, India. Trained using [Coqui TTS](https://github.com/coqui-ai/TTS) on a custom annotated speech corpus.
18
+
19
+ Four variants: **2 speakers** (male, female) × **2 input scripts** (Tamil script, Sourashtra script).
20
+
21
+ ---
22
+
23
+ ## Models
24
+
25
+ | Folder | Speaker | Input Script | Training Steps |
26
+ |--------|---------|--------------|----------------|
27
+ | `Sourashtra-Male_Script-tamil` | Male | Tamil (தமிழ்) | 300,000 |
28
+ | `Sourashtra-Male_Script-sourashtra` | Male | Sourashtra (ꢪꢾꢥꢶꢒ) | 300,000 |
29
+ | `Sourashtra-Female_Script-tamil` | Female | Tamil (தமிழ்) | 340,000 |
30
+ | `Sourashtra-Female_Script-sourashtra` | Female | Sourashtra (ꢪꢾꢥꢶꢒ) | 340,000 |
31
+
32
+ Each folder contains `best_model.pth`, `config.json`, `inference.py`, and `requirements.txt`.
33
+
34
+ ---
35
+
36
+ ## Setup
37
+
38
+ ```bash
39
+ pip install -r requirements.txt
40
+ ```
41
+
42
+ For GPU inference, install the CUDA-enabled PyTorch build matching your driver first — see [pytorch.org](https://pytorch.org/get-started/locally/).
43
+
44
+ ---
45
+
46
+ ## Usage
47
+
48
+ Run `inference.py` from inside the model folder:
49
+
50
+ ```bash
51
+ # Male — Tamil script
52
+ cd Sourashtra-Male_Script-tamil
53
+ python inference.py "சொராஷ்ட்ர மொழி" -o output.wav
54
+
55
+ # Male — Sourashtra script
56
+ cd Sourashtra-Male_Script-sourashtra
57
+ python inference.py "ꢪꢾꢥꢶꢒ ꢪꢒꢡ" -o output.wav
58
+
59
+ # Female — Tamil script
60
+ cd Sourashtra-Female_Script-tamil
61
+ python inference.py "சொராஷ்ட்ர மொழி" -o output.wav
62
+
63
+ # Female — Sourashtra script
64
+ cd Sourashtra-Female_Script-sourashtra
65
+ python inference.py "ꢪꢾꢥꢶꢒ ꢪꢒꢡ" -o output.wav
66
+ ```
67
+
68
+ Use `--gpu <id>` to select a GPU, or `--cpu` to force CPU inference.
69
+
70
+ ---
71
+
72
+ ## Script Notes
73
+
74
+ The Tamil-script and Sourashtra-script models produce speech from the same speaker — only the input orthography differs. Choose based on your text source.
75
+
76
+ - **Tamil script models** — strip `:`, `.`, `'` and apply NFC normalization automatically
77
+ - **Sourashtra script models** — strip Sourashtra Danda (꣎) and Double Danda (꣏) automatically
78
+
79
+ ---
80
+
81
+ ## Training
82
+
83
+ | Parameter | Value |
84
+ |-----------|-------|
85
+ | Architecture | VITS (end-to-end, flow-based) |
86
+ | Sample rate | 22050 Hz |
87
+ | Mel bins | 80 |
88
+ | Batch size | 16 |
89
+ | Mixed precision | Yes |
90
+ | Phonemes | No (character-level) |
91
+
92
+ Male training data: ~9,800–10,000 utterances. Female training data: ~11,400 utterances.
Sourashtra-Female_Script-sourashtra/README.md ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - saz
4
+ license: cc-by-4.0
5
+ tags:
6
+ - text-to-speech
7
+ - tts
8
+ - vits
9
+ - sourashtra
10
+ - low-resource
11
+ pipeline_tag: text-to-speech
12
+ ---
13
+
14
+ # VITS TTS — Sourashtra Female (Sourashtra Script)
15
+
16
+ VITS text-to-speech model for the [Sourashtra language](https://en.wikipedia.org/wiki/Sourashtra_language), a minority language spoken primarily in Tamil Nadu, India. This model uses **Sourashtra script** (ꢪꢾꢥꢶꢒ) input and synthesizes speech from a **female speaker**.
17
+
18
+ ## Model Details
19
+
20
+ | Property | Value |
21
+ |----------|-------|
22
+ | Architecture | [VITS](https://arxiv.org/abs/2106.06103) (Coqui TTS) |
23
+ | Speaker | Female |
24
+ | Input script | Sourashtra (Unicode block U+A880–U+A8D9) |
25
+ | Sample rate | 22050 Hz |
26
+ | Training steps | 340,000 |
27
+
28
+ ## Setup
29
+
30
+ ```bash
31
+ pip install -r requirements.txt
32
+ ```
33
+
34
+ For GPU inference, install the CUDA-enabled PyTorch build matching your driver first — see [pytorch.org](https://pytorch.org/get-started/locally/).
35
+
36
+ ## Usage
37
+
38
+ ```bash
39
+ python inference.py "ꢪꢾꢥꢶꢒ ꢪꢒꢡ" -o output.wav
40
+ python inference.py "ꢪꢾꢥꢶꢒ ꢪꢒꢡ" -o output.wav --gpu 1
41
+ python inference.py "ꢪꢾꢥꢶꢒ ꢪꢒꢡ" -o output.wav --cpu
42
+ ```
43
+
44
+ Input must be in Sourashtra script. For Tamil script input, use the `Sourashtra-Female_Script-tamil` model instead.
Sourashtra-Female_Script-sourashtra/best_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4bff515fc60c05aabcac5c7f4d7a22be2dc77e29521d9d8a7ee7790a7e715427
3
+ size 997843894
Sourashtra-Female_Script-sourashtra/config.json ADDED
@@ -0,0 +1,261 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "output_path": "./output_Sourashtra_Female_sourashtra",
3
+ "logger_uri": null,
4
+ "run_name": "vits_Sourashtra_Female_sourashtra",
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": null,
14
+ "save_step": 10000,
15
+ "save_n_checkpoints": 7,
16
+ "save_checkpoints": true,
17
+ "save_all_best": false,
18
+ "save_best_after": 0,
19
+ "target_loss": null,
20
+ "print_eval": true,
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": 500,
29
+ "batch_size": 16,
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": null,
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": 8,
56
+ "num_eval_loader_workers": 4,
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
+ "model_args": {
68
+ "num_chars": 97,
69
+ "out_channels": 513,
70
+ "spec_segment_size": 32,
71
+ "hidden_channels": 192,
72
+ "hidden_channels_ffn_text_encoder": 768,
73
+ "num_heads_text_encoder": 2,
74
+ "num_layers_text_encoder": 6,
75
+ "kernel_size_text_encoder": 3,
76
+ "dropout_p_text_encoder": 0.1,
77
+ "dropout_p_duration_predictor": 0.5,
78
+ "kernel_size_posterior_encoder": 5,
79
+ "dilation_rate_posterior_encoder": 1,
80
+ "num_layers_posterior_encoder": 16,
81
+ "kernel_size_flow": 5,
82
+ "dilation_rate_flow": 1,
83
+ "num_layers_flow": 4,
84
+ "resblock_type_decoder": "1",
85
+ "resblock_kernel_sizes_decoder": [
86
+ 3,
87
+ 7,
88
+ 11
89
+ ],
90
+ "resblock_dilation_sizes_decoder": [
91
+ [
92
+ 1,
93
+ 3,
94
+ 5
95
+ ],
96
+ [
97
+ 1,
98
+ 3,
99
+ 5
100
+ ],
101
+ [
102
+ 1,
103
+ 3,
104
+ 5
105
+ ]
106
+ ],
107
+ "upsample_rates_decoder": [
108
+ 8,
109
+ 8,
110
+ 2,
111
+ 2
112
+ ],
113
+ "upsample_initial_channel_decoder": 512,
114
+ "upsample_kernel_sizes_decoder": [
115
+ 16,
116
+ 16,
117
+ 4,
118
+ 4
119
+ ],
120
+ "periods_multi_period_discriminator": [
121
+ 2,
122
+ 3,
123
+ 5,
124
+ 7,
125
+ 11
126
+ ],
127
+ "use_sdp": true,
128
+ "noise_scale": 1.0,
129
+ "inference_noise_scale": 0.667,
130
+ "length_scale": 1,
131
+ "noise_scale_dp": 1.0,
132
+ "inference_noise_scale_dp": 1.0,
133
+ "max_inference_len": null,
134
+ "init_discriminator": true,
135
+ "use_spectral_norm_disriminator": false,
136
+ "use_speaker_embedding": false,
137
+ "num_speakers": 0,
138
+ "speakers_file": null,
139
+ "d_vector_file": null,
140
+ "speaker_embedding_channels": 256,
141
+ "use_d_vector_file": false,
142
+ "d_vector_dim": 0,
143
+ "detach_dp_input": true,
144
+ "use_language_embedding": false,
145
+ "embedded_language_dim": 4,
146
+ "num_languages": 0,
147
+ "language_ids_file": null,
148
+ "use_speaker_encoder_as_loss": false,
149
+ "speaker_encoder_config_path": "",
150
+ "speaker_encoder_model_path": "",
151
+ "condition_dp_on_speaker": true,
152
+ "freeze_encoder": false,
153
+ "freeze_DP": false,
154
+ "freeze_PE": false,
155
+ "freeze_flow_decoder": false,
156
+ "freeze_waveform_decoder": false,
157
+ "encoder_sample_rate": null,
158
+ "interpolate_z": true,
159
+ "reinit_DP": false,
160
+ "reinit_text_encoder": false
161
+ },
162
+ "_supports_cloning": false,
163
+ "use_phonemes": false,
164
+ "phonemizer": null,
165
+ "phoneme_language": "en-us",
166
+ "compute_input_seq_cache": true,
167
+ "text_cleaner": "multilingual_cleaners",
168
+ "enable_eos_bos_chars": false,
169
+ "test_sentences_file": "",
170
+ "phoneme_cache_path": "./output_Sourashtra_Female_sourashtra/phoneme_cache",
171
+ "characters": {
172
+ "characters_class": "TTS.tts.models.vits.VitsCharacters",
173
+ "vocab_dict": null,
174
+ "pad": "<PAD>",
175
+ "eos": "<EOS>",
176
+ "bos": "<BOS>",
177
+ "blank": "<BLNK>",
178
+ "characters": " !'(),-./12:?|\u00b3\u200d\ua882\ua883\ua884\ua885\ua886\ua887\ua888\ua889\ua88c\ua88d\ua88e\ua88f\ua890\ua891\ua892\ua893\ua894\ua895\ua896\ua897\ua898\ua899\ua89a\ua89b\ua89c\ua89d\ua89e\ua89f\ua8a0\ua8a1\ua8a2\ua8a3\ua8a4\ua8a5\ua8a6\ua8a7\ua8a8\ua8a9\ua8aa\ua8ab\ua8ac\ua8ad\ua8ae\ua8af\ua8b0\ua8b1\ua8b2\ua8b3\ua8b4\ua8b5\ua8b6\ua8b7\ua8b8\ua8b9\ua8ba\ua8be\ua8bf\ua8c0\ua8c1\ua8c2\ua8c3\ua8c4\ua8d1\ua8d2\ua8d3\ua8d8",
179
+ "punctuations": "!\u00a1'(),-.:;\u00bf? ",
180
+ "phonemes": null,
181
+ "is_unique": true,
182
+ "is_sorted": true
183
+ },
184
+ "add_blank": true,
185
+ "batch_group_size": 3,
186
+ "loss_masking": null,
187
+ "min_audio_len": 1,
188
+ "max_audio_len": Infinity,
189
+ "min_text_len": 1,
190
+ "max_text_len": Infinity,
191
+ "compute_f0": false,
192
+ "compute_energy": false,
193
+ "compute_linear_spec": true,
194
+ "precompute_num_workers": 0,
195
+ "start_by_longest": false,
196
+ "shuffle": false,
197
+ "drop_last": false,
198
+ "datasets": [
199
+ {
200
+ "formatter": "ljspeech",
201
+ "dataset_name": "",
202
+ "path": "./",
203
+ "meta_file_train": "sourashtra_dataset_female/processed/processed_female_ljspeech.csv",
204
+ "ignored_speakers": null,
205
+ "language": "",
206
+ "phonemizer": "",
207
+ "meta_file_val": "",
208
+ "meta_file_attn_mask": ""
209
+ }
210
+ ],
211
+ "test_sentences": [
212
+ [
213
+ "\ua88f\ua899\ua8a5\ua8b5\ua892\ua8c4 \ua88f\ua899\ua8a5\ua8c1 \ua8aa\ua8c1\ua8a5\ua8c4\ua8a5\ua8b8 \ua8b1\ua8c4\ua8a9\ua8b5\ua8ae\ua8c4 \ua899\ua8a5\ua8c4\ua8ad\ua8a5\ua8c4 \ua8af\ua8be\ua892\ua8c4\ua892\ua8b1\ua8c4\ua8a1\ua8c1 \ua8b2\ua8c1\ua8ab\ua8be \ua89a\ua8b8\ua894\ua8b8 \ua892\ua8b5\ua8ac\ua8a0\ua8b5\ua8a5\ua8b8\ua8aa\ua8c4 \ua88c\ua8ad\ua8c4\ua8ab\ua8c1 \ua88f\ua8a0\ua8c4\ua89c\ua8c4\ua8ab \ua892\ua8b5\ua8ac\ua8a0\ua8c1\ua892\ua8a5\ua8b6 \ua8b1\ua8bf \ua8aa\ua8be\ua8a5\ua8b6 \ua882\ua8aa\ua8b6 \ua892\ua8b3\ua8c0\ua8ad\ua8b6\ua8ac\ua8b6\ua8ab\ua8c1 \ua8a1\ua8be\ua8ad\ua8c4\ua8ab\ua892 \ua8b2\ua8b5\ua8ad\ua8c4 \ua897\ua8c1\ua892\ua8c4\ua892\ua89e\ua8b8\ua8b1\ua8c4",
214
+ "Sourashtra_Female_Sourashtra",
215
+ null,
216
+ "saz"
217
+ ]
218
+ ],
219
+ "eval_split_max_size": null,
220
+ "eval_split_size": 0.01,
221
+ "use_speaker_weighted_sampler": false,
222
+ "speaker_weighted_sampler_alpha": 1.0,
223
+ "use_language_weighted_sampler": false,
224
+ "language_weighted_sampler_alpha": 1.0,
225
+ "use_length_weighted_sampler": false,
226
+ "length_weighted_sampler_alpha": 1.0,
227
+ "lr_gen": 0.0002,
228
+ "lr_disc": 0.0002,
229
+ "lr_scheduler_gen": "ExponentialLR",
230
+ "lr_scheduler_gen_params": {
231
+ "gamma": 0.999875,
232
+ "last_epoch": -1
233
+ },
234
+ "lr_scheduler_disc": "ExponentialLR",
235
+ "lr_scheduler_disc_params": {
236
+ "gamma": 0.999875,
237
+ "last_epoch": -1
238
+ },
239
+ "kl_loss_alpha": 1.0,
240
+ "disc_loss_alpha": 1.0,
241
+ "gen_loss_alpha": 1.0,
242
+ "feat_loss_alpha": 1.0,
243
+ "mel_loss_alpha": 45.0,
244
+ "dur_loss_alpha": 1.0,
245
+ "speaker_encoder_loss_alpha": 1.0,
246
+ "return_wav": true,
247
+ "use_weighted_sampler": false,
248
+ "weighted_sampler_attrs": null,
249
+ "weighted_sampler_multipliers": null,
250
+ "r": 1,
251
+ "num_speakers": 0,
252
+ "use_speaker_embedding": false,
253
+ "speakers_file": null,
254
+ "speaker_embedding_channels": 256,
255
+ "language_ids_file": null,
256
+ "use_language_embedding": false,
257
+ "use_d_vector_file": false,
258
+ "d_vector_file": null,
259
+ "d_vector_dim": 0,
260
+ "github_branch": "inside_docker"
261
+ }
Sourashtra-Female_Script-sourashtra/inference.py ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """
3
+ Synthesize Sourashtra-script text with the female VITS checkpoint.
4
+
5
+ Usage:
6
+ python inference.py "ꢪꢾꢥꢶꢒ ꢪꢒꢡ" -o output.wav
7
+ python inference.py "ꢪꢾꢥꢶꢒ ꢪꢒꢡ" --gpu 1
8
+ python inference.py "ꢪꢾꢥꢶꢒ ꢪꢒꢡ" --cpu
9
+ """
10
+ import argparse
11
+ import os
12
+ import re
13
+ from pathlib import Path
14
+
15
+ import torch
16
+ from TTS.api import TTS
17
+
18
+ CHECKPOINT = "best_model.pth"
19
+ MODEL_DIR = Path(__file__).parent
20
+
21
+
22
+ def clean_text(text: str) -> str:
23
+ text = re.sub(r"(?:\{[^}]*\}\s*)+", lambda m: re.findall(r"\{([^}]*)\}", m.group(0))[-1].strip(), text)
24
+ text = text.replace("꣎", "").replace("꣏", "") # Sourashtra Danda / Double Danda
25
+ return re.sub(r" +", " ", text).strip()
26
+
27
+
28
+ def synthesize(tts, text: str, output_path: str) -> None:
29
+ tts.tts_to_file(text=text, file_path=output_path)
30
+
31
+
32
+ def main():
33
+ parser = argparse.ArgumentParser(description="Female Sourashtra-script TTS inference")
34
+ parser.add_argument("text", help="Input text in Sourashtra script")
35
+ parser.add_argument("-o", "--output", default="output.wav", help="Output WAV path (default: output.wav)")
36
+ parser.add_argument("--gpu", type=int, default=0, help="GPU device ID (default: 0)")
37
+ parser.add_argument("--cpu", action="store_true", help="Force CPU inference")
38
+ args = parser.parse_args()
39
+
40
+ if not args.cpu:
41
+ os.environ["CUDA_VISIBLE_DEVICES"] = str(args.gpu)
42
+
43
+ device = "cpu" if args.cpu else ("cuda:0" if torch.cuda.is_available() else "cpu")
44
+
45
+ tts = TTS(
46
+ model_path=str(MODEL_DIR / CHECKPOINT),
47
+ config_path=str(MODEL_DIR / "config.json"),
48
+ progress_bar=False,
49
+ )
50
+ tts.to(device)
51
+
52
+ text = clean_text(args.text)
53
+ print(f"Device : {device}")
54
+ print(f"Text : {text}")
55
+ print(f"Output : {args.output}")
56
+
57
+ synthesize(tts, text, args.output)
58
+ print("Done.")
59
+
60
+
61
+ if __name__ == "__main__":
62
+ main()
Sourashtra-Female_Script-sourashtra/requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ coqui-tts
2
+ torch
3
+ soundfile
4
+ numpy
Sourashtra-Female_Script-tamil/README.md ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - saz
4
+ - ta
5
+ license: cc-by-4.0
6
+ tags:
7
+ - text-to-speech
8
+ - tts
9
+ - vits
10
+ - sourashtra
11
+ - tamil
12
+ - low-resource
13
+ pipeline_tag: text-to-speech
14
+ ---
15
+
16
+ # VITS TTS — Sourashtra Female (Tamil Script)
17
+
18
+ VITS text-to-speech model for the [Sourashtra language](https://en.wikipedia.org/wiki/Sourashtra_language), a minority language spoken primarily in Tamil Nadu, India. This model uses **Tamil script** (தமிழ்) input and synthesizes speech from a **female speaker**.
19
+
20
+ ## Model Details
21
+
22
+ | Property | Value |
23
+ |----------|-------|
24
+ | Architecture | [VITS](https://arxiv.org/abs/2106.06103) (Coqui TTS) |
25
+ | Speaker | Female |
26
+ | Input script | Tamil |
27
+ | Sample rate | 22050 Hz |
28
+ | Training steps | 340,000 |
29
+
30
+ ## Setup
31
+
32
+ ```bash
33
+ pip install -r requirements.txt
34
+ ```
35
+
36
+ For GPU inference, install the CUDA-enabled PyTorch build matching your driver first — see [pytorch.org](https://pytorch.org/get-started/locally/).
37
+
38
+ ## Usage
39
+
40
+ ```bash
41
+ python inference.py "சொராஷ்ட்ர மொழி" -o output.wav
42
+ python inference.py "சொராஷ்ட்ர மொழி" -o output.wav --gpu 1
43
+ python inference.py "சொராஷ்ட்ர மொழி" -o output.wav --cpu
44
+ ```
45
+
46
+ Input must be in Tamil script. For Sourashtra script input, use the `Sourashtra-Female_Script-sourashtra` model instead.
Sourashtra-Female_Script-tamil/best_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bd5c1c34d515f12307434249042c77e8c83a2c2a7c087b84127ea1ce7b78b911
3
+ size 997811510
Sourashtra-Female_Script-tamil/config.json ADDED
@@ -0,0 +1,261 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "output_path": "./output_Sourashtra_Female_tamil",
3
+ "logger_uri": null,
4
+ "run_name": "vits_Sourashtra_Female_tamil",
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": null,
14
+ "save_step": 10000,
15
+ "save_n_checkpoints": 7,
16
+ "save_checkpoints": true,
17
+ "save_all_best": false,
18
+ "save_best_after": 0,
19
+ "target_loss": null,
20
+ "print_eval": true,
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": 500,
29
+ "batch_size": 16,
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": false,
53
+ "training_seed": 54321,
54
+ "model": "vits",
55
+ "num_loader_workers": 8,
56
+ "num_eval_loader_workers": 4,
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
+ "model_args": {
68
+ "num_chars": 83,
69
+ "out_channels": 513,
70
+ "spec_segment_size": 32,
71
+ "hidden_channels": 192,
72
+ "hidden_channels_ffn_text_encoder": 768,
73
+ "num_heads_text_encoder": 2,
74
+ "num_layers_text_encoder": 6,
75
+ "kernel_size_text_encoder": 3,
76
+ "dropout_p_text_encoder": 0.1,
77
+ "dropout_p_duration_predictor": 0.5,
78
+ "kernel_size_posterior_encoder": 5,
79
+ "dilation_rate_posterior_encoder": 1,
80
+ "num_layers_posterior_encoder": 16,
81
+ "kernel_size_flow": 5,
82
+ "dilation_rate_flow": 1,
83
+ "num_layers_flow": 4,
84
+ "resblock_type_decoder": "1",
85
+ "resblock_kernel_sizes_decoder": [
86
+ 3,
87
+ 7,
88
+ 11
89
+ ],
90
+ "resblock_dilation_sizes_decoder": [
91
+ [
92
+ 1,
93
+ 3,
94
+ 5
95
+ ],
96
+ [
97
+ 1,
98
+ 3,
99
+ 5
100
+ ],
101
+ [
102
+ 1,
103
+ 3,
104
+ 5
105
+ ]
106
+ ],
107
+ "upsample_rates_decoder": [
108
+ 8,
109
+ 8,
110
+ 2,
111
+ 2
112
+ ],
113
+ "upsample_initial_channel_decoder": 512,
114
+ "upsample_kernel_sizes_decoder": [
115
+ 16,
116
+ 16,
117
+ 4,
118
+ 4
119
+ ],
120
+ "periods_multi_period_discriminator": [
121
+ 2,
122
+ 3,
123
+ 5,
124
+ 7,
125
+ 11
126
+ ],
127
+ "use_sdp": true,
128
+ "noise_scale": 1.0,
129
+ "inference_noise_scale": 0.667,
130
+ "length_scale": 1,
131
+ "noise_scale_dp": 1.0,
132
+ "inference_noise_scale_dp": 1.0,
133
+ "max_inference_len": null,
134
+ "init_discriminator": true,
135
+ "use_spectral_norm_disriminator": false,
136
+ "use_speaker_embedding": false,
137
+ "num_speakers": 0,
138
+ "speakers_file": null,
139
+ "d_vector_file": null,
140
+ "speaker_embedding_channels": 256,
141
+ "use_d_vector_file": false,
142
+ "d_vector_dim": 0,
143
+ "detach_dp_input": true,
144
+ "use_language_embedding": false,
145
+ "embedded_language_dim": 4,
146
+ "num_languages": 0,
147
+ "language_ids_file": null,
148
+ "use_speaker_encoder_as_loss": false,
149
+ "speaker_encoder_config_path": "",
150
+ "speaker_encoder_model_path": "",
151
+ "condition_dp_on_speaker": true,
152
+ "freeze_encoder": false,
153
+ "freeze_DP": false,
154
+ "freeze_PE": false,
155
+ "freeze_flow_decoder": false,
156
+ "freeze_waveform_decoder": false,
157
+ "encoder_sample_rate": null,
158
+ "interpolate_z": true,
159
+ "reinit_DP": false,
160
+ "reinit_text_encoder": false
161
+ },
162
+ "_supports_cloning": false,
163
+ "use_phonemes": false,
164
+ "phonemizer": null,
165
+ "phoneme_language": "en-us",
166
+ "compute_input_seq_cache": true,
167
+ "text_cleaner": "multilingual_cleaners",
168
+ "enable_eos_bos_chars": false,
169
+ "test_sentences_file": "",
170
+ "phoneme_cache_path": "./output_Sourashtra_Female_tamil/phoneme_cache",
171
+ "characters": {
172
+ "characters_class": "TTS.tts.models.vits.VitsCharacters",
173
+ "vocab_dict": null,
174
+ "pad": "<PAD>",
175
+ "eos": "<EOS>",
176
+ "bos": "<BOS>",
177
+ "blank": "<BLNK>",
178
+ "characters": " !(),-/1234?\u00b2\u00b3\u02bc\u0b83\u0b85\u0b86\u0b87\u0b88\u0b89\u0b8a\u0b8e\u0b8f\u0b90\u0b92\u0b93\u0b94\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8\u0ba9\u0baa\u0bae\u0baf\u0bb0\u0bb1\u0bb2\u0bb3\u0bb4\u0bb5\u0bb6\u0bb7\u0bb8\u0bb9\u0bbe\u0bbf\u0bc0\u0bc1\u0bc2\u0bc6\u0bc7\u0bc8\u0bca\u0bcb\u0bcc\u0bcd\u0be7\u0bee\u200c\u2074\ua8d2",
179
+ "punctuations": "!\u00a1'(),-.:;\u00bf? ",
180
+ "phonemes": null,
181
+ "is_unique": true,
182
+ "is_sorted": true
183
+ },
184
+ "add_blank": true,
185
+ "batch_group_size": 3,
186
+ "loss_masking": null,
187
+ "min_audio_len": 1,
188
+ "max_audio_len": Infinity,
189
+ "min_text_len": 1,
190
+ "max_text_len": Infinity,
191
+ "compute_f0": false,
192
+ "compute_energy": false,
193
+ "compute_linear_spec": true,
194
+ "precompute_num_workers": 0,
195
+ "start_by_longest": false,
196
+ "shuffle": false,
197
+ "drop_last": false,
198
+ "datasets": [
199
+ {
200
+ "formatter": "ljspeech",
201
+ "dataset_name": "",
202
+ "path": "./",
203
+ "meta_file_train": "sourashtra_dataset_female/processed/processed_female_tamil_ljspeech.csv",
204
+ "ignored_speakers": null,
205
+ "language": "",
206
+ "phonemizer": "",
207
+ "meta_file_val": "",
208
+ "meta_file_attn_mask": ""
209
+ }
210
+ ],
211
+ "test_sentences": [
212
+ [
213
+ "\u0b92\u0b9c\u0ba9\u0bbe\u0b95\u0bcd \u0b92\u0b9c\u0ba9\u0bca \u0bae\u0bca\u0ba9\u0bcd\u0ba9\u0bc1 \u0bb8\u0bcd\u0baa\u0bbe4\u0bb5\u0bcd \u0b9c\u0ba9\u0bcd\u0bb2\u0ba9\u0bcd \u0bb6\u0bc6\u0b95\u0bcd\u0b95\u0bb8\u0bcd\u0ba4\u0bca \u0bb9\u0bca\u0baf\u0bc6 \u0b9c\u0bc12\u0b95\u0bc13 \u0b95\u0bbe\u0bb0\u0ba3\u0bbe\u0ba9\u0bc1\u0bae\u0bcd \u0b8e\u0bb2\u0bcd\u0baf\u0bca \u0b92\u0ba3\u0bcd\u0b9f\u0bcd\u0baf \u0b95\u0bbe\u0bb0\u0ba3\u0bca\u0b95\u0ba9\u0bbf \u0bb8\u0bc7 \u0bae\u0bc6\u0ba9\u0bbf \u0b85\u0bae\u0bbf \u0b95\u0bb3\u0bc8\u0bb2\u0bbf\u0bb0\u0bbf\u0baf\u0bca \u0ba4\u0bc6\u0bb2\u0bcd\u0baf\u0b95 \u0bb9\u0bbe\u0bb2\u0bcd \u0b9a\u0bca\u0b95\u0bcd\u0b95\u0b9f\u0bc13\u0bb8\u0bcd",
214
+ "Sourashtra_Female_Tamil",
215
+ null,
216
+ "ta"
217
+ ]
218
+ ],
219
+ "eval_split_max_size": null,
220
+ "eval_split_size": 0.01,
221
+ "use_speaker_weighted_sampler": false,
222
+ "speaker_weighted_sampler_alpha": 1.0,
223
+ "use_language_weighted_sampler": false,
224
+ "language_weighted_sampler_alpha": 1.0,
225
+ "use_length_weighted_sampler": false,
226
+ "length_weighted_sampler_alpha": 1.0,
227
+ "lr_gen": 0.0002,
228
+ "lr_disc": 0.0002,
229
+ "lr_scheduler_gen": "ExponentialLR",
230
+ "lr_scheduler_gen_params": {
231
+ "gamma": 0.999875,
232
+ "last_epoch": -1
233
+ },
234
+ "lr_scheduler_disc": "ExponentialLR",
235
+ "lr_scheduler_disc_params": {
236
+ "gamma": 0.999875,
237
+ "last_epoch": -1
238
+ },
239
+ "kl_loss_alpha": 1.0,
240
+ "disc_loss_alpha": 1.0,
241
+ "gen_loss_alpha": 1.0,
242
+ "feat_loss_alpha": 1.0,
243
+ "mel_loss_alpha": 45.0,
244
+ "dur_loss_alpha": 1.0,
245
+ "speaker_encoder_loss_alpha": 1.0,
246
+ "return_wav": true,
247
+ "use_weighted_sampler": false,
248
+ "weighted_sampler_attrs": {},
249
+ "weighted_sampler_multipliers": {},
250
+ "r": 1,
251
+ "num_speakers": 0,
252
+ "use_speaker_embedding": false,
253
+ "speakers_file": null,
254
+ "speaker_embedding_channels": 256,
255
+ "language_ids_file": null,
256
+ "use_language_embedding": false,
257
+ "use_d_vector_file": false,
258
+ "d_vector_file": null,
259
+ "d_vector_dim": 0,
260
+ "github_branch": "inside_docker"
261
+ }
Sourashtra-Female_Script-tamil/inference.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """
3
+ Synthesize Tamil-script text with the female VITS checkpoint.
4
+
5
+ Usage:
6
+ python inference.py "சொராஷ்ட்ர மொழி" -o output.wav
7
+ python inference.py "சொராஷ்ட்ர மொழி" --gpu 1
8
+ python inference.py "சொராஷ்ட்ர மொழி" --cpu
9
+ """
10
+ import argparse
11
+ import os
12
+ import re
13
+ import unicodedata
14
+ from pathlib import Path
15
+
16
+ import torch
17
+ from TTS.api import TTS
18
+
19
+ CHECKPOINT = "best_model.pth"
20
+ MODEL_DIR = Path(__file__).parent
21
+
22
+
23
+ def clean_text(text: str) -> str:
24
+ text = re.sub(r"(?:\{[^}]*\}\s*)+", lambda m: re.findall(r"\{([^}]*)\}", m.group(0))[-1].strip(), text)
25
+ text = unicodedata.normalize("NFC", text)
26
+ text = text.replace(":", "").replace(".", "").replace("'", "").replace("’", "")
27
+ return re.sub(r" +", " ", text).strip()
28
+
29
+
30
+ def synthesize(tts, text: str, output_path: str) -> None:
31
+ tts.tts_to_file(text=text, file_path=output_path)
32
+
33
+
34
+ def main():
35
+ parser = argparse.ArgumentParser(description="Female Tamil-script TTS inference")
36
+ parser.add_argument("text", help="Input text in Tamil script")
37
+ parser.add_argument("-o", "--output", default="output.wav", help="Output WAV path (default: output.wav)")
38
+ parser.add_argument("--gpu", type=int, default=0, help="GPU device ID (default: 0)")
39
+ parser.add_argument("--cpu", action="store_true", help="Force CPU inference")
40
+ args = parser.parse_args()
41
+
42
+ if not args.cpu:
43
+ os.environ["CUDA_VISIBLE_DEVICES"] = str(args.gpu)
44
+
45
+ device = "cpu" if args.cpu else ("cuda:0" if torch.cuda.is_available() else "cpu")
46
+
47
+ tts = TTS(
48
+ model_path=str(MODEL_DIR / CHECKPOINT),
49
+ config_path=str(MODEL_DIR / "config.json"),
50
+ progress_bar=False,
51
+ )
52
+ tts.to(device)
53
+
54
+ text = clean_text(args.text)
55
+ print(f"Device : {device}")
56
+ print(f"Text : {text}")
57
+ print(f"Output : {args.output}")
58
+
59
+ synthesize(tts, text, args.output)
60
+ print("Done.")
61
+
62
+
63
+ if __name__ == "__main__":
64
+ main()
Sourashtra-Female_Script-tamil/requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ coqui-tts
2
+ torch
3
+ soundfile
4
+ numpy
Sourashtra-Male_Script-sourashtra/README.md ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - saz
4
+ license: cc-by-4.0
5
+ tags:
6
+ - text-to-speech
7
+ - tts
8
+ - vits
9
+ - sourashtra
10
+ - low-resource
11
+ pipeline_tag: text-to-speech
12
+ ---
13
+
14
+ # VITS TTS — Sourashtra Male (Sourashtra Script)
15
+
16
+ VITS text-to-speech model for the [Sourashtra language](https://en.wikipedia.org/wiki/Sourashtra_language), a minority language spoken primarily in Tamil Nadu, India. This model uses **Sourashtra script** (ꢪꢾꢥꢶꢒ) input and synthesizes speech from a **male speaker**.
17
+
18
+ ## Model Details
19
+
20
+ | Property | Value |
21
+ |----------|-------|
22
+ | Architecture | [VITS](https://arxiv.org/abs/2106.06103) (Coqui TTS) |
23
+ | Speaker | Male |
24
+ | Input script | Sourashtra (Unicode block U+A880–U+A8D9) |
25
+ | Sample rate | 22050 Hz |
26
+ | Training steps | 300,000 |
27
+
28
+ ## Setup
29
+
30
+ ```bash
31
+ pip install -r requirements.txt
32
+ ```
33
+
34
+ For GPU inference, install the CUDA-enabled PyTorch build matching your driver first — see [pytorch.org](https://pytorch.org/get-started/locally/).
35
+
36
+ ## Usage
37
+
38
+ ```bash
39
+ python inference.py "ꢪꢾꢥꢶꢒ ꢪꢒꢡ" -o output.wav
40
+ python inference.py "ꢪꢾꢥꢶꢒ ꢪꢒꢡ" -o output.wav --gpu 1
41
+ python inference.py "ꢪꢾꢥꢶꢒ ꢪꢒꢡ" -o output.wav --cpu
42
+ ```
43
+
44
+ Input must be in Sourashtra script. For Tamil script input, use the `Sourashtra-Male_Script-tamil` model instead.
Sourashtra-Male_Script-sourashtra/best_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:820d5f9b3d55ad5331319a692f34af87c9721ed53802bdfc17dd32fb9612ac9e
3
+ size 997857718
Sourashtra-Male_Script-sourashtra/config.json ADDED
@@ -0,0 +1,261 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "output_path": "./output_Sourashtra_Male_Sourashtra",
3
+ "logger_uri": null,
4
+ "run_name": "vits_Sourashtra_Male_Sourashtra_sourashtra",
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": null,
14
+ "save_step": 10000,
15
+ "save_n_checkpoints": 7,
16
+ "save_checkpoints": true,
17
+ "save_all_best": false,
18
+ "save_best_after": 0,
19
+ "target_loss": null,
20
+ "print_eval": true,
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": 500,
29
+ "batch_size": 16,
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": null,
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": 8,
56
+ "num_eval_loader_workers": 4,
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
+ "model_args": {
68
+ "num_chars": 103,
69
+ "out_channels": 513,
70
+ "spec_segment_size": 32,
71
+ "hidden_channels": 192,
72
+ "hidden_channels_ffn_text_encoder": 768,
73
+ "num_heads_text_encoder": 2,
74
+ "num_layers_text_encoder": 6,
75
+ "kernel_size_text_encoder": 3,
76
+ "dropout_p_text_encoder": 0.1,
77
+ "dropout_p_duration_predictor": 0.5,
78
+ "kernel_size_posterior_encoder": 5,
79
+ "dilation_rate_posterior_encoder": 1,
80
+ "num_layers_posterior_encoder": 16,
81
+ "kernel_size_flow": 5,
82
+ "dilation_rate_flow": 1,
83
+ "num_layers_flow": 4,
84
+ "resblock_type_decoder": "1",
85
+ "resblock_kernel_sizes_decoder": [
86
+ 3,
87
+ 7,
88
+ 11
89
+ ],
90
+ "resblock_dilation_sizes_decoder": [
91
+ [
92
+ 1,
93
+ 3,
94
+ 5
95
+ ],
96
+ [
97
+ 1,
98
+ 3,
99
+ 5
100
+ ],
101
+ [
102
+ 1,
103
+ 3,
104
+ 5
105
+ ]
106
+ ],
107
+ "upsample_rates_decoder": [
108
+ 8,
109
+ 8,
110
+ 2,
111
+ 2
112
+ ],
113
+ "upsample_initial_channel_decoder": 512,
114
+ "upsample_kernel_sizes_decoder": [
115
+ 16,
116
+ 16,
117
+ 4,
118
+ 4
119
+ ],
120
+ "periods_multi_period_discriminator": [
121
+ 2,
122
+ 3,
123
+ 5,
124
+ 7,
125
+ 11
126
+ ],
127
+ "use_sdp": true,
128
+ "noise_scale": 1.0,
129
+ "inference_noise_scale": 0.667,
130
+ "length_scale": 1,
131
+ "noise_scale_dp": 1.0,
132
+ "inference_noise_scale_dp": 1.0,
133
+ "max_inference_len": null,
134
+ "init_discriminator": true,
135
+ "use_spectral_norm_disriminator": false,
136
+ "use_speaker_embedding": false,
137
+ "num_speakers": 0,
138
+ "speakers_file": null,
139
+ "d_vector_file": null,
140
+ "speaker_embedding_channels": 256,
141
+ "use_d_vector_file": false,
142
+ "d_vector_dim": 0,
143
+ "detach_dp_input": true,
144
+ "use_language_embedding": false,
145
+ "embedded_language_dim": 4,
146
+ "num_languages": 0,
147
+ "language_ids_file": null,
148
+ "use_speaker_encoder_as_loss": false,
149
+ "speaker_encoder_config_path": "",
150
+ "speaker_encoder_model_path": "",
151
+ "condition_dp_on_speaker": true,
152
+ "freeze_encoder": false,
153
+ "freeze_DP": false,
154
+ "freeze_PE": false,
155
+ "freeze_flow_decoder": false,
156
+ "freeze_waveform_decoder": false,
157
+ "encoder_sample_rate": null,
158
+ "interpolate_z": true,
159
+ "reinit_DP": false,
160
+ "reinit_text_encoder": false
161
+ },
162
+ "_supports_cloning": false,
163
+ "use_phonemes": false,
164
+ "phonemizer": null,
165
+ "phoneme_language": "en-us",
166
+ "compute_input_seq_cache": true,
167
+ "text_cleaner": "multilingual_cleaners",
168
+ "enable_eos_bos_chars": false,
169
+ "test_sentences_file": "",
170
+ "phoneme_cache_path": "./output_Sourashtra_Male_Sourashtra/phoneme_cache",
171
+ "characters": {
172
+ "characters_class": "TTS.tts.models.vits.VitsCharacters",
173
+ "vocab_dict": null,
174
+ "pad": "<PAD>",
175
+ "eos": "<EOS>",
176
+ "bos": "<BOS>",
177
+ "blank": "<BLNK>",
178
+ "characters": " !'(),-.1237:?ht\u00b3\u200d\u2074\ua882\ua883\ua884\ua885\ua886\ua887\ua888\ua889\ua88c\ua88d\ua88e\ua88f\ua890\ua891\ua892\ua893\ua894\ua895\ua896\ua897\ua898\ua899\ua89a\ua89b\ua89c\ua89d\ua89e\ua89f\ua8a0\ua8a1\ua8a2\ua8a3\ua8a4\ua8a5\ua8a6\ua8a7\ua8a8\ua8a9\ua8aa\ua8ab\ua8ac\ua8ad\ua8ae\ua8af\ua8b0\ua8b1\ua8b2\ua8b3\ua8b4\ua8b5\ua8b6\ua8b7\ua8b8\ua8b9\ua8ba\ua8be\ua8bf\ua8c0\ua8c1\ua8c2\ua8c3\ua8c4\ua8ce\ua8cf\ua8d1\ua8d2\ua8d3\ua8d5\ua8d7",
179
+ "punctuations": "!\u00a1'(),-.:;\u00bf? ",
180
+ "phonemes": null,
181
+ "is_unique": true,
182
+ "is_sorted": true
183
+ },
184
+ "add_blank": true,
185
+ "batch_group_size": 3,
186
+ "loss_masking": null,
187
+ "min_audio_len": 1,
188
+ "max_audio_len": Infinity,
189
+ "min_text_len": 1,
190
+ "max_text_len": Infinity,
191
+ "compute_f0": false,
192
+ "compute_energy": false,
193
+ "compute_linear_spec": true,
194
+ "precompute_num_workers": 0,
195
+ "start_by_longest": false,
196
+ "shuffle": false,
197
+ "drop_last": false,
198
+ "datasets": [
199
+ {
200
+ "formatter": "ljspeech",
201
+ "dataset_name": "",
202
+ "path": "./",
203
+ "meta_file_train": "sourashtra_dataset/processed/processed_sourashtra_ljspeech.csv",
204
+ "ignored_speakers": null,
205
+ "language": "",
206
+ "phonemizer": "",
207
+ "meta_file_val": "",
208
+ "meta_file_attn_mask": ""
209
+ }
210
+ ],
211
+ "test_sentences": [
212
+ [
213
+ "\ua88f\ua899\ua8a5\ua8b5\ua892\ua8c4 \ua88f\ua899\ua8a5\ua8c1 \ua8aa\ua8c1\ua8a5\ua8c4\ua8a5\ua8b8 \ua8b1\ua8c4\ua8a9\ua8b5\ua8ae\ua8c4 \ua899\ua8a5\ua8c4\ua8ad\ua8a5\ua8c4 \ua8af\ua8be\ua892\ua8c4\ua892\ua8b1\ua8c4\ua8a1\ua8c1 \ua8b2\ua8c1\ua8ab\ua8be \ua89a\ua8b8\ua894\ua8b8 \ua892\ua8b5\ua8ac\ua8a0\ua8b5\ua8a5\ua8b8\ua8aa\ua8c4 \ua88c\ua8ad\ua8c4\ua8ab\ua8c1 \ua88f\ua8a0\ua8c4\ua89c\ua8c4\ua8ab \ua892\ua8b5\ua8ac\ua8a0\ua8c1\ua892\ua8a5\ua8b6 \ua8b1\ua8bf \ua8aa\ua8be\ua8a5\ua8b6 \ua882\ua8aa\ua8b6 \ua892\ua8b3\ua8c0\ua8ad\ua8b6\ua8ac\ua8b6\ua8ab\ua8c1 \ua8a1\ua8be\ua8ad\ua8c4\ua8ab\ua892 \ua8b2\ua8b5\ua8ad\ua8c4 \ua897\ua8c1\ua892\ua8c4\ua892\ua89e\ua8b8\ua8b1\ua8c4",
214
+ "Sourashtra_Male_Sourashtra",
215
+ null,
216
+ "saz"
217
+ ]
218
+ ],
219
+ "eval_split_max_size": null,
220
+ "eval_split_size": 0.01,
221
+ "use_speaker_weighted_sampler": false,
222
+ "speaker_weighted_sampler_alpha": 1.0,
223
+ "use_language_weighted_sampler": false,
224
+ "language_weighted_sampler_alpha": 1.0,
225
+ "use_length_weighted_sampler": false,
226
+ "length_weighted_sampler_alpha": 1.0,
227
+ "lr_gen": 0.0002,
228
+ "lr_disc": 0.0002,
229
+ "lr_scheduler_gen": "ExponentialLR",
230
+ "lr_scheduler_gen_params": {
231
+ "gamma": 0.999875,
232
+ "last_epoch": -1
233
+ },
234
+ "lr_scheduler_disc": "ExponentialLR",
235
+ "lr_scheduler_disc_params": {
236
+ "gamma": 0.999875,
237
+ "last_epoch": -1
238
+ },
239
+ "kl_loss_alpha": 1.0,
240
+ "disc_loss_alpha": 1.0,
241
+ "gen_loss_alpha": 1.0,
242
+ "feat_loss_alpha": 1.0,
243
+ "mel_loss_alpha": 45.0,
244
+ "dur_loss_alpha": 1.0,
245
+ "speaker_encoder_loss_alpha": 1.0,
246
+ "return_wav": true,
247
+ "use_weighted_sampler": false,
248
+ "weighted_sampler_attrs": null,
249
+ "weighted_sampler_multipliers": null,
250
+ "r": 1,
251
+ "num_speakers": 0,
252
+ "use_speaker_embedding": false,
253
+ "speakers_file": null,
254
+ "speaker_embedding_channels": 256,
255
+ "language_ids_file": null,
256
+ "use_language_embedding": false,
257
+ "use_d_vector_file": false,
258
+ "d_vector_file": null,
259
+ "d_vector_dim": 0,
260
+ "github_branch": "inside_docker"
261
+ }
Sourashtra-Male_Script-sourashtra/inference.py ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """
3
+ Synthesize Sourashtra-script text with the male VITS checkpoint.
4
+
5
+ Usage:
6
+ python inference.py "ꢪꢾꢥꢶꢒ ꢪꢒꢡ" -o output.wav
7
+ python inference.py "ꢪꢾꢥꢶꢒ ꢪꢒꢡ" --gpu 1
8
+ python inference.py "ꢪꢾꢥꢶꢒ ꢪꢒꢡ" --cpu
9
+ """
10
+ import argparse
11
+ import os
12
+ import re
13
+ from pathlib import Path
14
+
15
+ import torch
16
+ from TTS.api import TTS
17
+
18
+ CHECKPOINT = "best_model.pth"
19
+ MODEL_DIR = Path(__file__).parent
20
+
21
+
22
+ def clean_text(text: str) -> str:
23
+ text = re.sub(r"(?:\{[^}]*\}\s*)+", lambda m: re.findall(r"\{([^}]*)\}", m.group(0))[-1].strip(), text)
24
+ text = text.replace("꣎", "").replace("꣏", "") # Sourashtra Danda / Double Danda
25
+ return re.sub(r" +", " ", text).strip()
26
+
27
+
28
+ def synthesize(tts, text: str, output_path: str) -> None:
29
+ tts.tts_to_file(text=text, file_path=output_path)
30
+
31
+
32
+ def main():
33
+ parser = argparse.ArgumentParser(description="Male Sourashtra-script TTS inference")
34
+ parser.add_argument("text", help="Input text in Sourashtra script")
35
+ parser.add_argument("-o", "--output", default="output.wav", help="Output WAV path (default: output.wav)")
36
+ parser.add_argument("--gpu", type=int, default=0, help="GPU device ID (default: 0)")
37
+ parser.add_argument("--cpu", action="store_true", help="Force CPU inference")
38
+ args = parser.parse_args()
39
+
40
+ if not args.cpu:
41
+ os.environ["CUDA_VISIBLE_DEVICES"] = str(args.gpu)
42
+
43
+ device = "cpu" if args.cpu else ("cuda:0" if torch.cuda.is_available() else "cpu")
44
+
45
+ tts = TTS(
46
+ model_path=str(MODEL_DIR / CHECKPOINT),
47
+ config_path=str(MODEL_DIR / "config.json"),
48
+ progress_bar=False,
49
+ )
50
+ tts.to(device)
51
+
52
+ text = clean_text(args.text)
53
+ print(f"Device : {device}")
54
+ print(f"Text : {text}")
55
+ print(f"Output : {args.output}")
56
+
57
+ synthesize(tts, text, args.output)
58
+ print("Done.")
59
+
60
+
61
+ if __name__ == "__main__":
62
+ main()
Sourashtra-Male_Script-sourashtra/requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ coqui-tts
2
+ torch
3
+ soundfile
4
+ numpy
Sourashtra-Male_Script-tamil/README.md ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - saz
4
+ - ta
5
+ license: cc-by-4.0
6
+ tags:
7
+ - text-to-speech
8
+ - tts
9
+ - vits
10
+ - sourashtra
11
+ - tamil
12
+ - low-resource
13
+ pipeline_tag: text-to-speech
14
+ ---
15
+
16
+ # VITS TTS — Sourashtra Male (Tamil Script)
17
+
18
+ VITS text-to-speech model for the [Sourashtra language](https://en.wikipedia.org/wiki/Sourashtra_language), a minority language spoken primarily in Tamil Nadu, India. This model uses **Tamil script** (தமிழ்) input and synthesizes speech from a **male speaker**.
19
+
20
+ ## Model Details
21
+
22
+ | Property | Value |
23
+ |----------|-------|
24
+ | Architecture | [VITS](https://arxiv.org/abs/2106.06103) (Coqui TTS) |
25
+ | Speaker | Male |
26
+ | Input script | Tamil |
27
+ | Sample rate | 22050 Hz |
28
+ | Training steps | 300,000 |
29
+
30
+ ## Setup
31
+
32
+ ```bash
33
+ pip install -r requirements.txt
34
+ ```
35
+
36
+ For GPU inference, install the CUDA-enabled PyTorch build matching your driver first — see [pytorch.org](https://pytorch.org/get-started/locally/).
37
+
38
+ ## Usage
39
+
40
+ ```bash
41
+ python inference.py "சொராஷ்ட்ர மொழி" -o output.wav
42
+ python inference.py "சொராஷ்ட்ர மொழி" -o output.wav --gpu 1
43
+ python inference.py "சொராஷ்ட்ர மொழி" -o output.wav --cpu
44
+ ```
45
+
46
+ Input must be in Tamil script. For Sourashtra script input, use the `Sourashtra-Male_Script-sourashtra` model instead.
Sourashtra-Male_Script-tamil/best_model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f93412aa19745844cda1675c5e33357ce0de0267c066756ae3a57a8f073d40e0
3
+ size 997809206
Sourashtra-Male_Script-tamil/config.json ADDED
@@ -0,0 +1,261 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "output_path": "./output_Sourashtra_Male_Tamil",
3
+ "logger_uri": null,
4
+ "run_name": "vits_Sourashtra_Male_Tamil_tamil",
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": null,
14
+ "save_step": 10000,
15
+ "save_n_checkpoints": 7,
16
+ "save_checkpoints": true,
17
+ "save_all_best": false,
18
+ "save_best_after": 0,
19
+ "target_loss": null,
20
+ "print_eval": true,
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": 500,
29
+ "batch_size": 16,
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": false,
53
+ "training_seed": 54321,
54
+ "model": "vits",
55
+ "num_loader_workers": 8,
56
+ "num_eval_loader_workers": 4,
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
+ "model_args": {
68
+ "num_chars": 82,
69
+ "out_channels": 513,
70
+ "spec_segment_size": 32,
71
+ "hidden_channels": 192,
72
+ "hidden_channels_ffn_text_encoder": 768,
73
+ "num_heads_text_encoder": 2,
74
+ "num_layers_text_encoder": 6,
75
+ "kernel_size_text_encoder": 3,
76
+ "dropout_p_text_encoder": 0.1,
77
+ "dropout_p_duration_predictor": 0.5,
78
+ "kernel_size_posterior_encoder": 5,
79
+ "dilation_rate_posterior_encoder": 1,
80
+ "num_layers_posterior_encoder": 16,
81
+ "kernel_size_flow": 5,
82
+ "dilation_rate_flow": 1,
83
+ "num_layers_flow": 4,
84
+ "resblock_type_decoder": "1",
85
+ "resblock_kernel_sizes_decoder": [
86
+ 3,
87
+ 7,
88
+ 11
89
+ ],
90
+ "resblock_dilation_sizes_decoder": [
91
+ [
92
+ 1,
93
+ 3,
94
+ 5
95
+ ],
96
+ [
97
+ 1,
98
+ 3,
99
+ 5
100
+ ],
101
+ [
102
+ 1,
103
+ 3,
104
+ 5
105
+ ]
106
+ ],
107
+ "upsample_rates_decoder": [
108
+ 8,
109
+ 8,
110
+ 2,
111
+ 2
112
+ ],
113
+ "upsample_initial_channel_decoder": 512,
114
+ "upsample_kernel_sizes_decoder": [
115
+ 16,
116
+ 16,
117
+ 4,
118
+ 4
119
+ ],
120
+ "periods_multi_period_discriminator": [
121
+ 2,
122
+ 3,
123
+ 5,
124
+ 7,
125
+ 11
126
+ ],
127
+ "use_sdp": true,
128
+ "noise_scale": 1.0,
129
+ "inference_noise_scale": 0.667,
130
+ "length_scale": 1,
131
+ "noise_scale_dp": 1.0,
132
+ "inference_noise_scale_dp": 1.0,
133
+ "max_inference_len": null,
134
+ "init_discriminator": true,
135
+ "use_spectral_norm_disriminator": false,
136
+ "use_speaker_embedding": false,
137
+ "num_speakers": 0,
138
+ "speakers_file": null,
139
+ "d_vector_file": null,
140
+ "speaker_embedding_channels": 256,
141
+ "use_d_vector_file": false,
142
+ "d_vector_dim": 0,
143
+ "detach_dp_input": true,
144
+ "use_language_embedding": false,
145
+ "embedded_language_dim": 4,
146
+ "num_languages": 0,
147
+ "language_ids_file": null,
148
+ "use_speaker_encoder_as_loss": false,
149
+ "speaker_encoder_config_path": "",
150
+ "speaker_encoder_model_path": "",
151
+ "condition_dp_on_speaker": true,
152
+ "freeze_encoder": false,
153
+ "freeze_DP": false,
154
+ "freeze_PE": false,
155
+ "freeze_flow_decoder": false,
156
+ "freeze_waveform_decoder": false,
157
+ "encoder_sample_rate": null,
158
+ "interpolate_z": true,
159
+ "reinit_DP": false,
160
+ "reinit_text_encoder": false
161
+ },
162
+ "_supports_cloning": false,
163
+ "use_phonemes": false,
164
+ "phonemizer": null,
165
+ "phoneme_language": "en-us",
166
+ "compute_input_seq_cache": true,
167
+ "text_cleaner": "multilingual_cleaners",
168
+ "enable_eos_bos_chars": false,
169
+ "test_sentences_file": "",
170
+ "phoneme_cache_path": "./output_Sourashtra_Male_Tamil/phoneme_cache",
171
+ "characters": {
172
+ "characters_class": "TTS.tts.models.vits.VitsCharacters",
173
+ "vocab_dict": null,
174
+ "pad": "<PAD>",
175
+ "eos": "<EOS>",
176
+ "bos": "<BOS>",
177
+ "blank": "<BLNK>",
178
+ "characters": " !(),-12345?ht\u00b2\u00b3\u02bc\u0b83\u0b85\u0b86\u0b87\u0b88\u0b89\u0b8a\u0b8e\u0b8f\u0b90\u0b92\u0b93\u0b94\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8\u0ba9\u0baa\u0bae\u0baf\u0bb0\u0bb1\u0bb2\u0bb3\u0bb4\u0bb5\u0bb6\u0bb7\u0bb8\u0bb9\u0bbe\u0bbf\u0bc0\u0bc1\u0bc2\u0bc6\u0bc7\u0bc8\u0bca\u0bcb\u0bcc\u0bcd\u200c\u2074",
179
+ "punctuations": "!\u00a1'(),-.:;\u00bf? ",
180
+ "phonemes": null,
181
+ "is_unique": true,
182
+ "is_sorted": true
183
+ },
184
+ "add_blank": true,
185
+ "batch_group_size": 3,
186
+ "loss_masking": null,
187
+ "min_audio_len": 1,
188
+ "max_audio_len": Infinity,
189
+ "min_text_len": 1,
190
+ "max_text_len": Infinity,
191
+ "compute_f0": false,
192
+ "compute_energy": false,
193
+ "compute_linear_spec": true,
194
+ "precompute_num_workers": 0,
195
+ "start_by_longest": false,
196
+ "shuffle": false,
197
+ "drop_last": false,
198
+ "datasets": [
199
+ {
200
+ "formatter": "ljspeech",
201
+ "dataset_name": "",
202
+ "path": "./",
203
+ "meta_file_train": "sourashtra_dataset/processed/processed_sourashtra_tamil_ljspeech.csv",
204
+ "ignored_speakers": null,
205
+ "language": "",
206
+ "phonemizer": "",
207
+ "meta_file_val": "",
208
+ "meta_file_attn_mask": ""
209
+ }
210
+ ],
211
+ "test_sentences": [
212
+ [
213
+ "\u0b92\u0b9c\u0ba9\u0bbe\u0b95\u0bcd \u0b92\u0b9c\u0ba9\u0bca \u0bae\u0bca\u0ba9\u0bcd\u0ba9\u0bc1 \u0bb8\u0bcd\u0baa\u0bbe4\u0bb5\u0bcd \u0b9c\u0ba9\u0bcd\u0bb2\u0ba9\u0bcd \u0bb6\u0bc6\u0b95\u0bcd\u0b95\u0bb8\u0bcd\u0ba4\u0bca \u0bb9\u0bca\u0baf\u0bc6 \u0b9c\u0bc12\u0b95\u0bc13 \u0b95\u0bbe\u0bb0\u0ba3\u0bbe\u0ba9\u0bc1\u0bae\u0bcd \u0b8e\u0bb2\u0bcd\u0baf\u0bca \u0b92\u0ba3\u0bcd\u0b9f\u0bcd\u0baf \u0b95\u0bbe\u0bb0\u0ba3\u0bca\u0b95\u0ba9\u0bbf \u0bb8\u0bc7 \u0bae\u0bc6\u0ba9\u0bbf \u0b85\u0bae\u0bbf \u0b95\u0bb3\u0bc8\u0bb2\u0bbf\u0bb0\u0bbf\u0baf\u0bca \u0ba4\u0bc6\u0bb2\u0bcd\u0baf\u0b95 \u0bb9\u0bbe\u0bb2\u0bcd \u0b9a\u0bca\u0b95\u0bcd\u0b95\u0b9f\u0bc13\u0bb8\u0bcd",
214
+ "Sourashtra_Male_Tamil",
215
+ null,
216
+ "ta"
217
+ ]
218
+ ],
219
+ "eval_split_max_size": null,
220
+ "eval_split_size": 0.01,
221
+ "use_speaker_weighted_sampler": false,
222
+ "speaker_weighted_sampler_alpha": 1.0,
223
+ "use_language_weighted_sampler": false,
224
+ "language_weighted_sampler_alpha": 1.0,
225
+ "use_length_weighted_sampler": false,
226
+ "length_weighted_sampler_alpha": 1.0,
227
+ "lr_gen": 0.0002,
228
+ "lr_disc": 0.0002,
229
+ "lr_scheduler_gen": "ExponentialLR",
230
+ "lr_scheduler_gen_params": {
231
+ "gamma": 0.999875,
232
+ "last_epoch": -1
233
+ },
234
+ "lr_scheduler_disc": "ExponentialLR",
235
+ "lr_scheduler_disc_params": {
236
+ "gamma": 0.999875,
237
+ "last_epoch": -1
238
+ },
239
+ "kl_loss_alpha": 1.0,
240
+ "disc_loss_alpha": 1.0,
241
+ "gen_loss_alpha": 1.0,
242
+ "feat_loss_alpha": 1.0,
243
+ "mel_loss_alpha": 45.0,
244
+ "dur_loss_alpha": 1.0,
245
+ "speaker_encoder_loss_alpha": 1.0,
246
+ "return_wav": true,
247
+ "use_weighted_sampler": false,
248
+ "weighted_sampler_attrs": {},
249
+ "weighted_sampler_multipliers": {},
250
+ "r": 1,
251
+ "num_speakers": 0,
252
+ "use_speaker_embedding": false,
253
+ "speakers_file": null,
254
+ "speaker_embedding_channels": 256,
255
+ "language_ids_file": null,
256
+ "use_language_embedding": false,
257
+ "use_d_vector_file": false,
258
+ "d_vector_file": null,
259
+ "d_vector_dim": 0,
260
+ "github_branch": "inside_docker"
261
+ }
Sourashtra-Male_Script-tamil/inference.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """
3
+ Synthesize Tamil-script text with the male VITS checkpoint.
4
+
5
+ Usage:
6
+ python inference.py "சொராஷ்ட்ர மொழி" -o output.wav
7
+ python inference.py "சொராஷ்ட்ர மொழி" --gpu 1
8
+ python inference.py "சொராஷ்ட்ர மொழி" --cpu
9
+ """
10
+ import argparse
11
+ import os
12
+ import re
13
+ import unicodedata
14
+ from pathlib import Path
15
+
16
+ import torch
17
+ from TTS.api import TTS
18
+
19
+ CHECKPOINT = "best_model.pth"
20
+ MODEL_DIR = Path(__file__).parent
21
+
22
+
23
+ def clean_text(text: str) -> str:
24
+ text = re.sub(r"(?:\{[^}]*\}\s*)+", lambda m: re.findall(r"\{([^}]*)\}", m.group(0))[-1].strip(), text)
25
+ text = unicodedata.normalize("NFC", text)
26
+ text = text.replace(":", "").replace(".", "").replace("'", "").replace("’", "")
27
+ return re.sub(r" +", " ", text).strip()
28
+
29
+
30
+ def synthesize(tts, text: str, output_path: str) -> None:
31
+ tts.tts_to_file(text=text, file_path=output_path)
32
+
33
+
34
+ def main():
35
+ parser = argparse.ArgumentParser(description="Male Tamil-script TTS inference")
36
+ parser.add_argument("text", help="Input text in Tamil script")
37
+ parser.add_argument("-o", "--output", default="output.wav", help="Output WAV path (default: output.wav)")
38
+ parser.add_argument("--gpu", type=int, default=0, help="GPU device ID (default: 0)")
39
+ parser.add_argument("--cpu", action="store_true", help="Force CPU inference")
40
+ args = parser.parse_args()
41
+
42
+ if not args.cpu:
43
+ os.environ["CUDA_VISIBLE_DEVICES"] = str(args.gpu)
44
+
45
+ device = "cpu" if args.cpu else ("cuda:0" if torch.cuda.is_available() else "cpu")
46
+
47
+ tts = TTS(
48
+ model_path=str(MODEL_DIR / CHECKPOINT),
49
+ config_path=str(MODEL_DIR / "config.json"),
50
+ progress_bar=False,
51
+ )
52
+ tts.to(device)
53
+
54
+ text = clean_text(args.text)
55
+ print(f"Device : {device}")
56
+ print(f"Text : {text}")
57
+ print(f"Output : {args.output}")
58
+
59
+ synthesize(tts, text, args.output)
60
+ print("Done.")
61
+
62
+
63
+ if __name__ == "__main__":
64
+ main()
Sourashtra-Male_Script-tamil/requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ coqui-tts
2
+ torch
3
+ soundfile
4
+ numpy