Initial commit
Browse files- README.md +37 -0
- added_tokens.json +3 -0
- config.json +108 -0
- model.safetensors +3 -0
- preprocessor_config.json +11 -0
- special_tokens_map.json +16 -0
- tokenizer_config.json +31 -0
- vocab.json +40 -0
README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MMS English Male
|
| 2 |
+
|
| 3 |
+
This model is trained using **IndicTTS dataset** with Hindi male speaker.
|
| 4 |
+
|
| 5 |
+
## Model
|
| 6 |
+
|
| 7 |
+
**mms-english-male-indic**: **English model with Hindi male speaker** from the IndicTTS dataset.
|
| 8 |
+
|
| 9 |
+
## Inference
|
| 10 |
+
|
| 11 |
+
To use these models for inference, you'll need to install the `transformers` and `accelerate` libraries.
|
| 12 |
+
|
| 13 |
+
First, install the necessary libraries:
|
| 14 |
+
|
| 15 |
+
```
|
| 16 |
+
pip install --upgrade transformers accelerate
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
Then, run inference with the following code-snippet:
|
| 20 |
+
|
| 21 |
+
```python
|
| 22 |
+
from transformers import VitsModel, AutoTokenizer
|
| 23 |
+
import torch
|
| 24 |
+
from IPython.display import Audio
|
| 25 |
+
|
| 26 |
+
model_path = "./mms-english-male-indic" # This is the path to your fine-tuned model
|
| 27 |
+
model = VitsModel.from_pretrained(model_path)
|
| 28 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
| 29 |
+
|
| 30 |
+
text = "This is an English model trained using a Hindi male speaker."
|
| 31 |
+
inputs = tokenizer(text, return_tensors="pt")
|
| 32 |
+
|
| 33 |
+
with torch.no_grad():
|
| 34 |
+
output = model(**inputs).waveform
|
| 35 |
+
|
| 36 |
+
Audio(output.numpy(), rate=model.config.sampling_rate)
|
| 37 |
+
```
|
added_tokens.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"<unk>": 38
|
| 3 |
+
}
|
config.json
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "/opt/data/dhatta/models/mms_tts/finetune-hf-vits/oz_vits_eng",
|
| 3 |
+
"activation_dropout": 0.1,
|
| 4 |
+
"architectures": [
|
| 5 |
+
"VitsModelForPreTraining"
|
| 6 |
+
],
|
| 7 |
+
"attention_dropout": 0.1,
|
| 8 |
+
"depth_separable_channels": 2,
|
| 9 |
+
"depth_separable_num_layers": 3,
|
| 10 |
+
"discriminator_kernel_size": 5,
|
| 11 |
+
"discriminator_period_channels": [
|
| 12 |
+
1,
|
| 13 |
+
32,
|
| 14 |
+
128,
|
| 15 |
+
512,
|
| 16 |
+
1024
|
| 17 |
+
],
|
| 18 |
+
"discriminator_periods": [
|
| 19 |
+
2,
|
| 20 |
+
3,
|
| 21 |
+
5,
|
| 22 |
+
7,
|
| 23 |
+
11
|
| 24 |
+
],
|
| 25 |
+
"discriminator_scale_channels": [
|
| 26 |
+
1,
|
| 27 |
+
16,
|
| 28 |
+
64,
|
| 29 |
+
256,
|
| 30 |
+
1024
|
| 31 |
+
],
|
| 32 |
+
"discriminator_stride": 3,
|
| 33 |
+
"duration_predictor_dropout": 0.5,
|
| 34 |
+
"duration_predictor_filter_channels": 256,
|
| 35 |
+
"duration_predictor_flow_bins": 10,
|
| 36 |
+
"duration_predictor_kernel_size": 3,
|
| 37 |
+
"duration_predictor_num_flows": 4,
|
| 38 |
+
"duration_predictor_tail_bound": 5.0,
|
| 39 |
+
"ffn_dim": 768,
|
| 40 |
+
"ffn_kernel_size": 3,
|
| 41 |
+
"flow_size": 192,
|
| 42 |
+
"hidden_act": "relu",
|
| 43 |
+
"hidden_dropout": 0.1,
|
| 44 |
+
"hidden_size": 192,
|
| 45 |
+
"hop_length": 256,
|
| 46 |
+
"initializer_range": 0.02,
|
| 47 |
+
"layer_norm_eps": 1e-05,
|
| 48 |
+
"layerdrop": 0.1,
|
| 49 |
+
"leaky_relu_slope": 0.1,
|
| 50 |
+
"model_type": "vits",
|
| 51 |
+
"noise_scale": 0.667,
|
| 52 |
+
"noise_scale_duration": 0.8,
|
| 53 |
+
"num_attention_heads": 2,
|
| 54 |
+
"num_hidden_layers": 6,
|
| 55 |
+
"num_speakers": 1,
|
| 56 |
+
"posterior_encoder_num_wavenet_layers": 16,
|
| 57 |
+
"prior_encoder_num_flows": 4,
|
| 58 |
+
"prior_encoder_num_wavenet_layers": 4,
|
| 59 |
+
"resblock_dilation_sizes": [
|
| 60 |
+
[
|
| 61 |
+
1,
|
| 62 |
+
3,
|
| 63 |
+
5
|
| 64 |
+
],
|
| 65 |
+
[
|
| 66 |
+
1,
|
| 67 |
+
3,
|
| 68 |
+
5
|
| 69 |
+
],
|
| 70 |
+
[
|
| 71 |
+
1,
|
| 72 |
+
3,
|
| 73 |
+
5
|
| 74 |
+
]
|
| 75 |
+
],
|
| 76 |
+
"resblock_kernel_sizes": [
|
| 77 |
+
3,
|
| 78 |
+
7,
|
| 79 |
+
11
|
| 80 |
+
],
|
| 81 |
+
"sampling_rate": 16000,
|
| 82 |
+
"segment_size": 8192,
|
| 83 |
+
"speaker_embedding_size": 0,
|
| 84 |
+
"speaking_rate": 1.0,
|
| 85 |
+
"spectrogram_bins": 513,
|
| 86 |
+
"torch_dtype": "float32",
|
| 87 |
+
"transformers_version": "4.46.2",
|
| 88 |
+
"upsample_initial_channel": 512,
|
| 89 |
+
"upsample_kernel_sizes": [
|
| 90 |
+
16,
|
| 91 |
+
16,
|
| 92 |
+
4,
|
| 93 |
+
4
|
| 94 |
+
],
|
| 95 |
+
"upsample_rates": [
|
| 96 |
+
8,
|
| 97 |
+
8,
|
| 98 |
+
2,
|
| 99 |
+
2
|
| 100 |
+
],
|
| 101 |
+
"use_bias": true,
|
| 102 |
+
"use_stochastic_duration_prediction": true,
|
| 103 |
+
"vocab_size": 38,
|
| 104 |
+
"wavenet_dilation_rate": 1,
|
| 105 |
+
"wavenet_dropout": 0.0,
|
| 106 |
+
"wavenet_kernel_size": 5,
|
| 107 |
+
"window_size": 4
|
| 108 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:336f3e2e3bc9178ddef95d6e5f6c33e9aacebed8b4d69fedc23f1fa2d7cc403e
|
| 3 |
+
size 332160712
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"feature_extractor_type": "VitsFeatureExtractor",
|
| 3 |
+
"feature_size": 80,
|
| 4 |
+
"hop_length": 256,
|
| 5 |
+
"max_wav_value": 32768.0,
|
| 6 |
+
"n_fft": 1024,
|
| 7 |
+
"padding_side": "right",
|
| 8 |
+
"padding_value": 0.0,
|
| 9 |
+
"return_attention_mask": false,
|
| 10 |
+
"sampling_rate": 16000
|
| 11 |
+
}
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"pad_token": {
|
| 3 |
+
"content": "k",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"unk_token": {
|
| 10 |
+
"content": "<unk>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
}
|
| 16 |
+
}
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_blank": true,
|
| 3 |
+
"added_tokens_decoder": {
|
| 4 |
+
"0": {
|
| 5 |
+
"content": "k",
|
| 6 |
+
"lstrip": false,
|
| 7 |
+
"normalized": false,
|
| 8 |
+
"rstrip": false,
|
| 9 |
+
"single_word": false,
|
| 10 |
+
"special": true
|
| 11 |
+
},
|
| 12 |
+
"38": {
|
| 13 |
+
"content": "<unk>",
|
| 14 |
+
"lstrip": false,
|
| 15 |
+
"normalized": false,
|
| 16 |
+
"rstrip": false,
|
| 17 |
+
"single_word": false,
|
| 18 |
+
"special": true
|
| 19 |
+
}
|
| 20 |
+
},
|
| 21 |
+
"clean_up_tokenization_spaces": true,
|
| 22 |
+
"is_uroman": false,
|
| 23 |
+
"language": "eng",
|
| 24 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 25 |
+
"normalize": true,
|
| 26 |
+
"pad_token": "k",
|
| 27 |
+
"phonemize": false,
|
| 28 |
+
"tokenizer_class": "VitsTokenizer",
|
| 29 |
+
"unk_token": "<unk>",
|
| 30 |
+
"verbose": false
|
| 31 |
+
}
|
vocab.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
" ": 19,
|
| 3 |
+
"'": 1,
|
| 4 |
+
"-": 14,
|
| 5 |
+
"0": 23,
|
| 6 |
+
"1": 15,
|
| 7 |
+
"2": 28,
|
| 8 |
+
"3": 11,
|
| 9 |
+
"4": 27,
|
| 10 |
+
"5": 35,
|
| 11 |
+
"6": 36,
|
| 12 |
+
"_": 30,
|
| 13 |
+
"a": 26,
|
| 14 |
+
"b": 24,
|
| 15 |
+
"c": 12,
|
| 16 |
+
"d": 5,
|
| 17 |
+
"e": 7,
|
| 18 |
+
"f": 20,
|
| 19 |
+
"g": 37,
|
| 20 |
+
"h": 6,
|
| 21 |
+
"i": 18,
|
| 22 |
+
"j": 16,
|
| 23 |
+
"k": 0,
|
| 24 |
+
"l": 21,
|
| 25 |
+
"m": 17,
|
| 26 |
+
"n": 29,
|
| 27 |
+
"o": 22,
|
| 28 |
+
"p": 13,
|
| 29 |
+
"q": 34,
|
| 30 |
+
"r": 25,
|
| 31 |
+
"s": 8,
|
| 32 |
+
"t": 33,
|
| 33 |
+
"u": 4,
|
| 34 |
+
"v": 32,
|
| 35 |
+
"w": 9,
|
| 36 |
+
"x": 31,
|
| 37 |
+
"y": 3,
|
| 38 |
+
"z": 2,
|
| 39 |
+
"–": 10
|
| 40 |
+
}
|