Simonlob commited on
Commit
eed7f3e
0 Parent(s):

Duplicate from Simonlob/TTS_AkylAI_2

Browse files
.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,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ inference: true
4
+ tags:
5
+ - mms
6
+ - vits
7
+ pipeline_tag: text-to-speech
8
+ language:
9
+ - ky
10
+ ---
11
+
12
+ # Introduction
13
+
14
+ This repository contains a text-to-speech (TTS) model fine-tuned on data consisting of sentences in the Kyrgyz language with audio examples voiced by a single speaker. The audio is provided at a sample rate of 16 kHz. The dataset comprises 3500 examples and 4 hours of audio. The model is based on the facebook/mms-tts-kir model pre-trained on the Kyrgyz language. The code for fine-tuning the model was based on the code from this [GitHub repository](https://github.com/ylacombe/finetune-hf-vits). Experimental findings concluded that the best results are achieved through two-stage fine-tuning:
15
+
16
+ * Training with Learning Rate 1e-4 and 4 epochs,
17
+ * Training with Learning Rate 9e-7 and 80 epochs.
18
+
19
+
20
+ # MMS: Scaling Speech Technology to 1000+ languages
21
+
22
+ The Massively Multilingual Speech (MMS) project expands speech technology from about 100 languages to over 1,000 by building a single multilingual speech recognition model supporting over 1,100 languages (more than 10 times as many as before), language identification models able to identify over [4,000 languages](https://dl.fbaipublicfiles.com/mms/misc/language_coverage_mms.html) (40 times more than before), pretrained models supporting over 1,400 languages, and text-to-speech models for over 1,100 languages. Our goal is to make it easier for people to access information and to use devices in their preferred language.
23
+
24
+ You can find details in the paper [Scaling Speech Technology to 1000+ languages](https://research.facebook.com/publications/scaling-speech-technology-to-1000-languages/) and the [blog post](https://ai.facebook.com/blog/multilingual-model-speech-recognition/).
25
+
26
+ An overview of the languages covered by MMS can be found [here](https://dl.fbaipublicfiles.com/mms/misc/language_coverage_mms.html).
27
+
28
+ ## Transformers
29
+
30
+ MMS has been added to Transformers. For more information, please refer to [Transformers' MMS docs](https://huggingface.co/docs/transformers/main/en/model_doc/mms).
31
+
32
+ [Click here](https://huggingface.co/models?other=mms) to find all MMS checkpoints on the Hub.
33
+
34
+ Checkout the demo here [![Open In HF Spaces](https://huggingface.co/datasets/huggingface/badges/raw/main/open-in-hf-spaces-sm-dark.svg)](https://huggingface.co/spaces/facebook/MMS)
35
+
36
+ ##
37
+
38
+
39
+ # Inference
40
+
41
+
42
+ The model takes Cyrillic text in the Kyrgyz language as input and preprocesses it by removing punctuation marks (periods, commas, colons, exclamation and question marks) as well as words written in Latin script. Therefore, it is not advisable to feed multiple sentences into the model at once as they will be vocalized without intonational pauses, indicating the end of one and the beginning of a new sentence. Words written in Latin script will be skipped in the generated speech.
43
+
44
+ For example:
45
+ ```
46
+ text = 'Кандай улут болбосун кыргызча жооп кайтарышыбыз керек.'
47
+ ```
48
+
49
+ You can use this model by executing the code provided below.
50
+
51
+ ```
52
+ import subprocess
53
+ from transformers import pipeline
54
+ from IPython.display import Audio
55
+ import numpy as np
56
+ import torch
57
+ import scipy
58
+
59
+ model_id = "Simonlob/simonlob_akylay"
60
+ synthesiser = pipeline("text-to-speech", model_id) # add device=0 if you want to use a GPU
61
+
62
+ ```
63
+
64
+ ```
65
+ text = 'Кандай улут болбосун кыргызча жооп кайтарышыбыз керек.'
66
+ speech = synthesiser(text)
67
+ ```
68
+ The output of the model looks as follows:
69
+ ```
70
+ {'audio': array([[-1.7045566e-04, 8.9107212e-05, 2.8329418e-04, ...,
71
+ 8.0898666e-08, 4.8763245e-06, 5.4663483e-06]], dtype=float32),
72
+ 'sampling_rate': 16000}
73
+ ```
74
+
75
+ Listen to the result:
76
+
77
+ ```
78
+ Audio(speech['audio'], rate=speech['sampling_rate'])
79
+ ```
80
+
81
+ Save the audio as a file:
82
+
83
+ ```
84
+ scipy.io.wavfile.write("<OUTPUT PATH>.wav", rate=speech["sampling_rate"], data=speech["audio"][0])
85
+ ```
86
+
87
+
88
+
89
+ </details>
90
+
91
+ ## Model details
92
+
93
+ - **Model type:** Text-to-speech model
94
+ - **License:** CC-BY-NC 4.0 license
95
+ - **Cite as:**
96
+
97
+ @article{pratap2023mms,
98
+ title={Scaling Speech Technology to 1,000+ Languages},
99
+ 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},
100
+ journal={arXiv},
101
+ year={2023}
102
+ }
103
+
104
+
105
+ ## Credits
106
+
107
+
108
+ - Facebook AI Research ([Official Space](https://huggingface.co/spaces/facebook/MMS))
109
+ - Yoach Lacombe (Research) [GitHub](https://github.com/ylacombe/finetune-hf-vits)
110
+ - The Cramer Project (Data collection and preprocessing)[Official Space](https://thecramer.com/), [Akyl_AI](https://github.com/Akyl-AI)
111
+ - Amantur Amatov (Expert)
112
+ - Timur Turatali (Expert, Research) [GitHub](https://github.com/golden-ratio)
113
+ - Den Pavlov (Research, Data preprocessing and fine-tuning) [GitHub](https://github.com/simonlobgromov/finetune-hf-vits)
114
+ - Ulan Abdurazakov (Environment Developer)
115
+ - Nursultan Bakashov (CEO)
116
+
117
+
118
+ ## Additional Links
119
+
120
+ - [Blog post](https://ai.facebook.com/blog/multilingual-model-speech-recognition/)
121
+ - [Transformers documentation](https://huggingface.co/docs/transformers/main/en/model_doc/mms).
122
+ - [Paper](https://arxiv.org/abs/2305.13516)
123
+ - [GitHub Repository for fine tuning](https://github.com/ylacombe/finetune-hf-vits)
124
+ - [GitHub Repository](https://github.com/facebookresearch/fairseq/tree/main/examples/mms#asr)
125
+ - [Other **MMS** checkpoints](https://huggingface.co/models?other=mms)
126
+ - MMS base checkpoints:
127
+ - [facebook/mms-1b](https://huggingface.co/facebook/mms-1b)
128
+ - [facebook/mms-300m](https://huggingface.co/facebook/mms-300m)
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": "Simonlob/TTS_AkylAI_2",
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.38.1",
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:744167b99051dd58b2b1f138f200b0cb20720e57dd209be9249b27512a7edf4c
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": "ж",
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": "ж",
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": "kir",
24
+ "model_max_length": 1000000000000000019884624838656,
25
+ "normalize": true,
26
+ "pad_token": "ж",
27
+ "phonemize": false,
28
+ "tokenizer_class": "VitsTokenizer",
29
+ "unk_token": "<unk>",
30
+ "verbose": false
31
+ }
vocab.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ " ": 14,
3
+ "-": 13,
4
+ "_": 16,
5
+ "а": 19,
6
+ "б": 30,
7
+ "в": 31,
8
+ "г": 35,
9
+ "д": 20,
10
+ "е": 8,
11
+ "ж": 0,
12
+ "з": 27,
13
+ "и": 4,
14
+ "й": 10,
15
+ "к": 26,
16
+ "л": 11,
17
+ "м": 36,
18
+ "н": 23,
19
+ "о": 9,
20
+ "п": 32,
21
+ "р": 24,
22
+ "с": 22,
23
+ "т": 21,
24
+ "у": 12,
25
+ "ф": 37,
26
+ "х": 28,
27
+ "ц": 1,
28
+ "ч": 33,
29
+ "ш": 25,
30
+ "ы": 5,
31
+ "ь": 34,
32
+ "э": 18,
33
+ "ю": 6,
34
+ "я": 7,
35
+ "ё": 29,
36
+ "ң": 17,
37
+ "ү": 15,
38
+ "ө": 2,
39
+ "–": 3
40
+ }