indicnode
/

Text-to-Speech
PyTorch
Safetensors
vits
mms
indicnodeai sanchit-gandhi commited on
Commit
a7677d2
·
0 Parent(s):

Duplicate from facebook/mms-tts-mal

Browse files

Co-authored-by: Sanchit Gandhi <sanchit-gandhi@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz 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
README.md ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+ license: cc-by-nc-4.0
4
+ tags:
5
+ - mms
6
+ - vits
7
+ pipeline_tag: text-to-speech
8
+ ---
9
+
10
+ # Massively Multilingual Speech (MMS): Malayalam Text-to-Speech
11
+
12
+ This repository contains the **Malayalam (mal)** language text-to-speech (TTS) model checkpoint.
13
+
14
+ This model is part of Facebook's [Massively Multilingual Speech](https://arxiv.org/abs/2305.13516) project, aiming to
15
+ provide speech technology across a diverse range of languages. You can find more details about the supported languages
16
+ and their ISO 639-3 codes in the [MMS Language Coverage Overview](https://dl.fbaipublicfiles.com/mms/misc/language_coverage_mms.html),
17
+ and see all MMS-TTS checkpoints on the Hugging Face Hub: [facebook/mms-tts](https://huggingface.co/models?sort=trending&search=facebook%2Fmms-tts).
18
+
19
+ MMS-TTS is available in the 🤗 Transformers library from version 4.33 onwards.
20
+
21
+ ## Model Details
22
+
23
+ VITS (**V**ariational **I**nference with adversarial learning for end-to-end **T**ext-to-**S**peech) is an end-to-end
24
+ speech synthesis model that predicts a speech waveform conditional on an input text sequence. It is a conditional variational
25
+ autoencoder (VAE) comprised of a posterior encoder, decoder, and conditional prior.
26
+
27
+ A set of spectrogram-based acoustic features are predicted by the flow-based module, which is formed of a Transformer-based
28
+ text encoder and multiple coupling layers. The spectrogram is decoded using a stack of transposed convolutional layers,
29
+ much in the same style as the HiFi-GAN vocoder. Motivated by the one-to-many nature of the TTS problem, where the same text
30
+ input can be spoken in multiple ways, the model also includes a stochastic duration predictor, which allows the model to
31
+ synthesise speech with different rhythms from the same input text.
32
+
33
+ The model is trained end-to-end with a combination of losses derived from variational lower bound and adversarial training.
34
+ To improve the expressiveness of the model, normalizing flows are applied to the conditional prior distribution. During
35
+ inference, the text encodings are up-sampled based on the duration prediction module, and then mapped into the
36
+ waveform using a cascade of the flow module and HiFi-GAN decoder. Due to the stochastic nature of the duration predictor,
37
+ the model is non-deterministic, and thus requires a fixed seed to generate the same speech waveform.
38
+
39
+ For the MMS project, a separate VITS checkpoint is trained on each langauge.
40
+
41
+ ## Usage
42
+
43
+ MMS-TTS is available in the 🤗 Transformers library from version 4.33 onwards. To use this checkpoint,
44
+ first install the latest version of the library:
45
+
46
+ ```
47
+ pip install --upgrade transformers accelerate
48
+ ```
49
+
50
+ Then, run inference with the following code-snippet:
51
+
52
+ ```python
53
+ from transformers import VitsModel, AutoTokenizer
54
+ import torch
55
+
56
+ model = VitsModel.from_pretrained("facebook/mms-tts-mal")
57
+ tokenizer = AutoTokenizer.from_pretrained("facebook/mms-tts-mal")
58
+
59
+ text = "some example text in the Malayalam language"
60
+ inputs = tokenizer(text, return_tensors="pt")
61
+
62
+ with torch.no_grad():
63
+ output = model(**inputs).waveform
64
+ ```
65
+
66
+ The resulting waveform can be saved as a `.wav` file:
67
+
68
+ ```python
69
+ import scipy
70
+
71
+ scipy.io.wavfile.write("techno.wav", rate=model.config.sampling_rate, data=output)
72
+ ```
73
+
74
+ Or displayed in a Jupyter Notebook / Google Colab:
75
+
76
+ ```python
77
+ from IPython.display import Audio
78
+
79
+ Audio(output, rate=model.config.sampling_rate)
80
+ ```
81
+
82
+
83
+
84
+ ## BibTex citation
85
+
86
+ This model was developed by Vineel Pratap et al. from Meta AI. If you use the model, consider citing the MMS paper:
87
+
88
+ ```
89
+ @article{pratap2023mms,
90
+ title={Scaling Speech Technology to 1,000+ Languages},
91
+ author={Vineel Pratap and Andros Tjandra and Bowen Shi and Paden Tomasello and Arun Babu and Sayani Kundu and Ali Elkahky and Zhaoheng Ni and Apoorv Vyas and Maryam Fazel-Zarandi and Alexei Baevski and Yossi Adi and Xiaohui Zhang and Wei-Ning Hsu and Alexis Conneau and Michael Auli},
92
+ journal={arXiv},
93
+ year={2023}
94
+ }
95
+ ```
96
+
97
+ ## License
98
+
99
+ The model is licensed as **CC-BY-NC 4.0**.
config.json ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation_dropout": 0.1,
3
+ "architectures": [
4
+ "VitsModel"
5
+ ],
6
+ "attention_dropout": 0.1,
7
+ "depth_separable_channels": 2,
8
+ "depth_separable_num_layers": 3,
9
+ "duration_predictor_dropout": 0.5,
10
+ "duration_predictor_filter_channels": 256,
11
+ "duration_predictor_flow_bins": 10,
12
+ "duration_predictor_kernel_size": 3,
13
+ "duration_predictor_num_flows": 4,
14
+ "duration_predictor_tail_bound": 5.0,
15
+ "ffn_dim": 768,
16
+ "ffn_kernel_size": 3,
17
+ "flow_size": 192,
18
+ "hidden_act": "relu",
19
+ "hidden_dropout": 0.1,
20
+ "hidden_size": 192,
21
+ "initializer_range": 0.02,
22
+ "layer_norm_eps": 1e-05,
23
+ "layerdrop": 0.1,
24
+ "leaky_relu_slope": 0.1,
25
+ "model_type": "vits",
26
+ "noise_scale": 0.667,
27
+ "noise_scale_duration": 0.8,
28
+ "num_attention_heads": 2,
29
+ "num_hidden_layers": 6,
30
+ "num_speakers": 1,
31
+ "posterior_encoder_num_wavenet_layers": 16,
32
+ "prior_encoder_num_flows": 4,
33
+ "prior_encoder_num_wavenet_layers": 4,
34
+ "resblock_dilation_sizes": [
35
+ [
36
+ 1,
37
+ 3,
38
+ 5
39
+ ],
40
+ [
41
+ 1,
42
+ 3,
43
+ 5
44
+ ],
45
+ [
46
+ 1,
47
+ 3,
48
+ 5
49
+ ]
50
+ ],
51
+ "resblock_kernel_sizes": [
52
+ 3,
53
+ 7,
54
+ 11
55
+ ],
56
+ "sampling_rate": 16000,
57
+ "speaker_embedding_size": 0,
58
+ "speaking_rate": 1.0,
59
+ "spectrogram_bins": 513,
60
+ "torch_dtype": "float32",
61
+ "transformers_version": "4.33.0.dev0",
62
+ "upsample_initial_channel": 512,
63
+ "upsample_kernel_sizes": [
64
+ 16,
65
+ 16,
66
+ 4,
67
+ 4
68
+ ],
69
+ "upsample_rates": [
70
+ 8,
71
+ 8,
72
+ 2,
73
+ 2
74
+ ],
75
+ "use_bias": true,
76
+ "use_stochastic_duration_prediction": true,
77
+ "vocab_size": 84,
78
+ "wavenet_dilation_rate": 1,
79
+ "wavenet_dropout": 0.0,
80
+ "wavenet_kernel_size": 5,
81
+ "window_size": 4
82
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a97a1e677ec67e05124b799dadd66630181fe9c29beb4e590454689ff8f698c5
3
+ size 145262840
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:046f0de3c235f75b96b478bab98bebcfe8468a11add65a8cde3f88f2cb2c63b9
3
+ size 145424050
special_tokens_map.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "pad_token": "—",
3
+ "unk_token": "<unk>"
4
+ }
tokenizer_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_blank": true,
3
+ "clean_up_tokenization_spaces": true,
4
+ "is_uroman": false,
5
+ "language": "mal",
6
+ "model_max_length": 1000000000000000019884624838656,
7
+ "normalize": true,
8
+ "pad_token": "—",
9
+ "phonemize": false,
10
+ "tokenizer_class": "VitsTokenizer",
11
+ "unk_token": "<unk>"
12
+ }
vocab.json ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ " ": 61,
3
+ "'": 81,
4
+ "-": 33,
5
+ "0": 6,
6
+ "1": 57,
7
+ "2": 54,
8
+ "3": 66,
9
+ "4": 23,
10
+ "5": 79,
11
+ "6": 46,
12
+ "_": 43,
13
+ "c": 75,
14
+ "i": 18,
15
+ "m": 30,
16
+ "o": 73,
17
+ "q": 82,
18
+ "ം": 29,
19
+ "ഃ": 38,
20
+ "അ": 63,
21
+ "ആ": 26,
22
+ "ഇ": 10,
23
+ "ഈ": 67,
24
+ "ഉ": 19,
25
+ "ഊ": 13,
26
+ "എ": 47,
27
+ "ഏ": 45,
28
+ "ഐ": 80,
29
+ "ഒ": 5,
30
+ "ഓ": 51,
31
+ "ഔ": 68,
32
+ "ക": 56,
33
+ "ഖ": 8,
34
+ "ഗ": 39,
35
+ "ഘ": 50,
36
+ "ങ": 59,
37
+ "ച": 14,
38
+ "ഛ": 35,
39
+ "ജ": 31,
40
+ "ഞ": 9,
41
+ "ട": 37,
42
+ "ഠ": 22,
43
+ "ഡ": 11,
44
+ "ഢ": 62,
45
+ "ണ": 40,
46
+ "ത": 1,
47
+ "ഥ": 49,
48
+ "ദ": 78,
49
+ "ധ": 32,
50
+ "ന": 71,
51
+ "പ": 69,
52
+ "ഫ": 20,
53
+ "ബ": 65,
54
+ "ഭ": 60,
55
+ "മ": 64,
56
+ "യ": 16,
57
+ "ര": 2,
58
+ "റ": 44,
59
+ "ല": 21,
60
+ "ള": 3,
61
+ "ഴ": 4,
62
+ "വ": 76,
63
+ "ശ": 83,
64
+ "ഷ": 17,
65
+ "സ": 27,
66
+ "ഹ": 34,
67
+ "ാ": 15,
68
+ "ി": 12,
69
+ "ീ": 52,
70
+ "ു": 28,
71
+ "ൂ": 7,
72
+ "ൃ": 74,
73
+ "െ": 24,
74
+ "േ": 55,
75
+ "ൈ": 53,
76
+ "ൊ": 72,
77
+ "ോ": 42,
78
+ "്": 36,
79
+ "ൗ": 25,
80
+ "ൺ": 70,
81
+ "ൻ": 77,
82
+ "ർ": 48,
83
+ "ൽ": 41,
84
+ "ൾ": 58,
85
+ "—": 0
86
+ }