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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
tags:
|
4 |
+
- audio
|
5 |
+
- text-to-speech
|
6 |
+
datasets:
|
7 |
+
- libritts
|
8 |
+
---
|
9 |
+
|
10 |
+
# SpeechT5 (TTS task)
|
11 |
+
|
12 |
+
SpeechT5 model fine-tuned for speech synthesis (text-to-speech) on LibriTTS.
|
13 |
+
|
14 |
+
This model was introduced in [SpeechT5: Unified-Modal Encoder-Decoder Pre-Training for Spoken Language Processing](https://arxiv.org/abs/2110.07205) by Junyi Ao, Rui Wang, Long Zhou, Chengyi Wang, Shuo Ren, Yu Wu, Shujie Liu, Tom Ko, Qing Li, Yu Zhang, Zhihua Wei, Yao Qian, Jinyu Li, Furu Wei.
|
15 |
+
|
16 |
+
SpeechT5 was first released in [this repository](https://github.com/microsoft/SpeechT5/), [original weights](https://huggingface.co/mechanicalsea/speecht5-tts). The license used is [MIT](https://github.com/microsoft/SpeechT5/blob/main/LICENSE).
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
+
## Model Description
|
21 |
+
|
22 |
+
Motivated by the success of T5 (Text-To-Text Transfer Transformer) in pre-trained natural language processing models, we propose a unified-modal SpeechT5 framework that explores the encoder-decoder pre-training for self-supervised speech/text representation learning. The SpeechT5 framework consists of a shared encoder-decoder network and six modal-specific (speech/text) pre/post-nets. After preprocessing the input speech/text through the pre-nets, the shared encoder-decoder network models the sequence-to-sequence transformation, and then the post-nets generate the output in the speech/text modality based on the output of the decoder.
|
23 |
+
|
24 |
+
Leveraging large-scale unlabeled speech and text data, we pre-train SpeechT5 to learn a unified-modal representation, hoping to improve the modeling capability for both speech and text. To align the textual and speech information into this unified semantic space, we propose a cross-modal vector quantization approach that randomly mixes up speech/text states with latent units as the interface between encoder and decoder.
|
25 |
+
|
26 |
+
Extensive evaluations show the superiority of the proposed SpeechT5 framework on a wide variety of spoken language processing tasks, including automatic speech recognition, speech synthesis, speech translation, voice conversion, speech enhancement, and speaker identification.
|
27 |
+
|
28 |
+
- **Developed by:** Junyi Ao, Rui Wang, Long Zhou, Chengyi Wang, Shuo Ren, Yu Wu, Shujie Liu, Tom Ko, Qing Li, Yu Zhang, Zhihua Wei, Yao Qian, Jinyu Li, Furu Wei.
|
29 |
+
- **Shared by [optional]:** [Matthijs Hollemans](https://huggingface.co/Matthijs)
|
30 |
+
- **Model type:** text-to-speech
|
31 |
+
- **Language(s) (NLP):** [More Information Needed]
|
32 |
+
- **License:** [MIT](https://github.com/microsoft/SpeechT5/blob/main/LICENSE)
|
33 |
+
- **Finetuned from model [optional]:** [More Information Needed]
|
34 |
+
|
35 |
+
|
36 |
+
## Model Sources [optional]
|
37 |
+
|
38 |
+
<!-- Provide the basic links for the model. -->
|
39 |
+
|
40 |
+
- **Repository:** [https://github.com/microsoft/SpeechT5/]
|
41 |
+
- **Paper:** [https://arxiv.org/pdf/2110.07205.pdf]
|
42 |
+
- **Blog Post:** [https://huggingface.co/blog/speecht5]
|
43 |
+
- **Demo:** [https://huggingface.co/spaces/Matthijs/speecht5-tts-demo]
|
44 |
+
|
45 |
+
|
46 |
+
# Uses
|
47 |
+
|
48 |
+
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
49 |
+
|
50 |
+
## Direct Use
|
51 |
+
|
52 |
+
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
53 |
+
|
54 |
+
You can use this model for speech synthesis. See the [model hub](https://huggingface.co/models?search=speecht5) to look for fine-tuned versions on a task that interests you.
|
55 |
+
|
56 |
+
## Downstream Use [optional]
|
57 |
+
|
58 |
+
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
59 |
+
|
60 |
+
[More Information Needed]
|
61 |
+
|
62 |
+
## Out-of-Scope Use
|
63 |
+
|
64 |
+
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
65 |
+
|
66 |
+
[More Information Needed]
|
67 |
+
|
68 |
+
# Bias, Risks, and Limitations
|
69 |
+
|
70 |
+
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
71 |
+
|
72 |
+
[More Information Needed]
|
73 |
+
|
74 |
+
## Recommendations
|
75 |
+
|
76 |
+
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
77 |
+
|
78 |
+
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
79 |
+
|
80 |
+
|
81 |
+
## How to Get Started With the Model
|
82 |
+
|
83 |
+
Use the code below to convert text into a mono 16 kHz speech waveform.
|
84 |
+
|
85 |
+
```python
|
86 |
+
# Following pip packages need to be installed:
|
87 |
+
# !pip install git+https://github.com/huggingface/transformers sentencepiece datasets
|
88 |
+
|
89 |
+
from transformers import SpeechT5Processor, SpeechT5ForTextToSpeech, SpeechT5HifiGan
|
90 |
+
from datasets import load_dataset
|
91 |
+
import torch
|
92 |
+
import soundfile as sf
|
93 |
+
from datasets import load_dataset
|
94 |
+
|
95 |
+
processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
96 |
+
model = SpeechT5ForTextToSpeech.from_pretrained("microsoft/speecht5_tts")
|
97 |
+
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")
|
98 |
+
|
99 |
+
inputs = processor(text="Hello, my dog is cute", return_tensors="pt")
|
100 |
+
|
101 |
+
# load xvector containing speaker's voice characteristics from a dataset
|
102 |
+
embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
|
103 |
+
speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze(0)
|
104 |
+
|
105 |
+
speech = model.generate_speech(inputs["input_ids"], speaker_embeddings, vocoder=vocoder)
|
106 |
+
|
107 |
+
sf.write("speech.wav", speech.numpy(), samplerate=16000)
|
108 |
+
```
|
109 |
+
|
110 |
+
### Fine-tuning the Model
|
111 |
+
|
112 |
+
Refer to [this Colab notebook](https://colab.research.google.com/drive/1i7I5pzBcU3WDFarDnzweIj4-sVVoIUFJ) for an example of how to fine-tune SpeechT5 for TTS on a different dataset or a new language.
|
113 |
+
|
114 |
+
# Training Details
|
115 |
+
|
116 |
+
## Training Data
|
117 |
+
|
118 |
+
<!-- This should link to a Data Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
119 |
+
|
120 |
+
LibriTTS
|
121 |
+
|
122 |
+
## Training Procedure
|
123 |
+
|
124 |
+
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
125 |
+
|
126 |
+
### Preprocessing [optional]
|
127 |
+
|
128 |
+
Leveraging large-scale unlabeled speech and text data, we pre-train SpeechT5 to learn a unified-modal representation, hoping to improve the modeling capability for both speech and text.
|
129 |
+
|
130 |
+
|
131 |
+
### Training hyperparameters
|
132 |
+
- **Precision:** [More Information Needed] <!--fp16, bf16, fp8, fp32 -->
|
133 |
+
- **Regime:** [More Information Needed] <!--mixed precision or not -->
|
134 |
+
|
135 |
+
### Speeds, Sizes, Times [optional]
|
136 |
+
|
137 |
+
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
138 |
+
|
139 |
+
[More Information Needed]
|
140 |
+
|
141 |
+
# Evaluation
|
142 |
+
|
143 |
+
<!-- This section describes the evaluation protocols and provides the results. -->
|
144 |
+
|
145 |
+
## Testing Data, Factors & Metrics
|
146 |
+
|
147 |
+
### Testing Data
|
148 |
+
|
149 |
+
<!-- This should link to a Data Card if possible. -->
|
150 |
+
|
151 |
+
[More Information Needed]
|
152 |
+
|
153 |
+
### Factors
|
154 |
+
|
155 |
+
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
156 |
+
|
157 |
+
[More Information Needed]
|
158 |
+
|
159 |
+
### Metrics
|
160 |
+
|
161 |
+
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
162 |
+
|
163 |
+
[More Information Needed]
|
164 |
+
|
165 |
+
## Results
|
166 |
+
|
167 |
+
[More Information Needed]
|
168 |
+
|
169 |
+
### Summary
|
170 |
+
|
171 |
+
|
172 |
+
|
173 |
+
# Model Examination [optional]
|
174 |
+
|
175 |
+
<!-- Relevant interpretability work for the model goes here -->
|
176 |
+
|
177 |
+
Extensive evaluations show the superiority of the proposed SpeechT5 framework on a wide variety of spoken language processing tasks, including automatic speech recognition, speech synthesis, speech translation, voice conversion, speech enhancement, and speaker identification.
|
178 |
+
|
179 |
+
# Environmental Impact
|
180 |
+
|
181 |
+
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
182 |
+
|
183 |
+
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
184 |
+
|
185 |
+
- **Hardware Type:** [More Information Needed]
|
186 |
+
- **Hours used:** [More Information Needed]
|
187 |
+
- **Cloud Provider:** [More Information Needed]
|
188 |
+
- **Compute Region:** [More Information Needed]
|
189 |
+
- **Carbon Emitted:** [More Information Needed]
|
190 |
+
|
191 |
+
# Technical Specifications [optional]
|
192 |
+
|
193 |
+
## Model Architecture and Objective
|
194 |
+
|
195 |
+
The SpeechT5 framework consists of a shared encoder-decoder network and six modal-specific (speech/text) pre/post-nets.
|
196 |
+
|
197 |
+
After preprocessing the input speech/text through the pre-nets, the shared encoder-decoder network models the sequence-to-sequence transformation, and then the post-nets generate the output in the speech/text modality based on the output of the decoder.
|
198 |
+
|
199 |
+
## Compute Infrastructure
|
200 |
+
|
201 |
+
[More Information Needed]
|
202 |
+
|
203 |
+
### Hardware
|
204 |
+
|
205 |
+
[More Information Needed]
|
206 |
+
|
207 |
+
### Software
|
208 |
+
|
209 |
+
[More Information Needed]
|
210 |
+
|
211 |
+
# Citation [optional]
|
212 |
+
|
213 |
+
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
214 |
+
|
215 |
+
**BibTeX:**
|
216 |
+
|
217 |
+
```bibtex
|
218 |
+
@inproceedings{ao-etal-2022-speecht5,
|
219 |
+
title = {{S}peech{T}5: Unified-Modal Encoder-Decoder Pre-Training for Spoken Language Processing},
|
220 |
+
author = {Ao, Junyi and Wang, Rui and Zhou, Long and Wang, Chengyi and Ren, Shuo and Wu, Yu and Liu, Shujie and Ko, Tom and Li, Qing and Zhang, Yu and Wei, Zhihua and Qian, Yao and Li, Jinyu and Wei, Furu},
|
221 |
+
booktitle = {Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
|
222 |
+
month = {May},
|
223 |
+
year = {2022},
|
224 |
+
pages={5723--5738},
|
225 |
+
}
|
226 |
+
```
|
227 |
+
|
228 |
+
# Glossary [optional]
|
229 |
+
|
230 |
+
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
231 |
+
|
232 |
+
- **text-to-speech** to synthesize audio
|
233 |
+
|
234 |
+
# More Information [optional]
|
235 |
+
|
236 |
+
[More Information Needed]
|
237 |
+
|
238 |
+
# Model Card Authors [optional]
|
239 |
+
|
240 |
+
Disclaimer: The team releasing SpeechT5 did not write a model card for this model so this model card has been written by the Hugging Face team.
|
241 |
+
|
242 |
+
# Model Card Contact
|
243 |
+
|
244 |
+
[More Information Needed]
|
245 |
+
|
246 |
+
|
247 |
+
|