connor-henderson commited on
Commit
8216811
1 Parent(s): e0ef449

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +247 -0
README.md ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ library_name: transformers
6
+ ---
7
+ # FastSpeech2Conformer
8
+
9
+ <!-- Provide a quick summary of what the model is/does. -->
10
+
11
+ FastSpeech2Conformer is a non-autoregressive text-to-speech (TTS) model that combines the strengths of FastSpeech2 and the conformer architecture to generate high-quality speech from text quickly and efficiently.
12
+
13
+
14
+ ### Model Description
15
+
16
+ <!-- Provide a longer summary of what this model is. -->
17
+
18
+ The FastSpeech2Conformer model was proposed with the paper [Recent Developments On Espnet Toolkit Boosted By Conformer](https://arxiv.org/abs/2010.13956) by Pengcheng Guo, Florian Boyer, Xuankai Chang, Tomoki Hayashi, Yosuke Higuchi, Hirofumi Inaguma, Naoyuki Kamo, Chenda Li, Daniel Garcia-Romero, Jiatong Shi, Jing Shi, Shinji Watanabe, Kun Wei, Wangyou Zhang, and Yuekai Zhang. It was first released [in this repository](https://github.com/espnet/espnet). The license used is [Apache 2.0](https://github.com/espnet/espnet/blob/master/LICENSE).
19
+
20
+ FastSpeech2 is a non-autoregressive TTS model, which means it can generate speech significantly faster than autoregressive models. It addresses some of the limitations of its predecessor, FastSpeech, by directly training the model with ground-truth targets instead of the simplified output from a teacher model. It also introduces more variation information of speech (e.g., pitch, energy, and more accurate duration) as conditional inputs. Furthermore, the conformer (convolutional transformer) architecture makes use of convolutions inside the transformer blocks to capture local speech patterns, while the attention layer is able to capture relationships in the input that are farther away.
21
+
22
+ - **Developed by:** Pengcheng Guo, Florian Boyer, Xuankai Chang, Tomoki Hayashi, Yosuke Higuchi, Hirofumi Inaguma, Naoyuki Kamo, Chenda Li, Daniel Garcia-Romero, Jiatong Shi, Jing Shi, Shinji Watanabe, Kun Wei, Wangyou Zhang, and Yuekai Zhang.
23
+ - **Shared by:** Connor Henderson
24
+ - **Model type:** text-to-speech
25
+ - **Language(s) (NLP):** [More Information Needed]
26
+ - **License:** [Apache 2.0](https://github.com/espnet/espnet/blob/master/LICENSE)
27
+ - **Finetuned from model [optional]:** [More Information Needed]
28
+
29
+ ### Model Sources [optional]
30
+
31
+ <!-- Provide the basic links for the model. -->
32
+
33
+ - **Repository:** [ESPnet](https://github.com/espnet/espnet)
34
+ - **Paper [optional]:** [Recent Developments On Espnet Toolkit Boosted By Conformer](https://arxiv.org/abs/2010.13956)
35
+
36
+ ## 🤗 Transformers Usage
37
+
38
+ You can run FastSpeech2Conformer locally with the 🤗 Transformers library.
39
+
40
+ 1. First install the 🤗 [Transformers library](https://github.com/huggingface/transformers), g2p-en:
41
+
42
+ ```
43
+ pip install --upgrade pip
44
+ pip install --upgrade transformers g2p-en
45
+ ```
46
+
47
+ 2. Run inference via the Transformers modelling code with the model and hifigan separately
48
+
49
+ ```python
50
+
51
+ from transformers import FastSpeech2ConformerTokenizer, FastSpeech2ConformerModel, FastSpeech2ConformerHifiGan
52
+ import soundfile as sf
53
+
54
+ tokenizer = FastSpeech2ConformerTokenizer.from_pretrained("espnet/fastspeech2_conformer")
55
+ inputs = tokenizer("Hello, my dog is cute.", return_tensors="pt")
56
+ input_ids = inputs["input_ids"]
57
+
58
+ model = FastSpeech2ConformerModel.from_pretrained("espnet/fastspeech2_conformer")
59
+ output_dict = model(input_ids, return_dict=True)
60
+ spectrogram = output_dict["spectrogram"]
61
+
62
+ hifigan = FastSpeech2ConformerHifiGan.from_pretrained("espnet/fastspeech2_conformer_hifigan")
63
+ waveform = hifigan(spectrogram)
64
+
65
+ sf.write("speech.wav", waveform.squeeze().detach().numpy(), samplerate=22050)
66
+ ```
67
+
68
+ 3. Run inference via the Transformers modelling code with the model and hifigan combined
69
+
70
+ ```python
71
+
72
+ from transformers import FastSpeech2ConformerTokenizer, FastSpeech2ConformerWithHifiGan
73
+ import soundfile as sf
74
+
75
+ tokenizer = FastSpeech2ConformerTokenizer.from_pretrained("espnet/fastspeech2_conformer")
76
+ inputs = tokenizer("Hello, my dog is cute.", return_tensors="pt")
77
+ input_ids = inputs["input_ids"]
78
+
79
+ model = FastSpeech2ConformerWithHifiGan.from_pretrained("espnet/fastspeech2_conformer_with_hifigan")
80
+ output_dict = model(input_ids, return_dict=True)
81
+ waveform = output_dict["waveform"]
82
+
83
+ sf.write("speech.wav", waveform.squeeze().detach().numpy(), samplerate=22050)
84
+ ```
85
+
86
+ ### Direct Use
87
+
88
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
89
+
90
+ [More Information Needed]
91
+
92
+ ### Downstream Use [optional]
93
+
94
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
95
+
96
+ [More Information Needed]
97
+
98
+ ### Out-of-Scope Use
99
+
100
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
101
+
102
+ [More Information Needed]
103
+
104
+ ## Bias, Risks, and Limitations
105
+
106
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
107
+
108
+ [More Information Needed]
109
+
110
+ ### Recommendations
111
+
112
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
113
+
114
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
115
+
116
+ ## How to Get Started with the Model
117
+
118
+ Use the code below to get started with the model.
119
+
120
+ [More Information Needed]
121
+
122
+ ## Training Details
123
+
124
+ ### Training Data
125
+
126
+ <!-- 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. -->
127
+
128
+ [More Information Needed]
129
+
130
+ ### Training Procedure
131
+
132
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
133
+
134
+ #### Preprocessing [optional]
135
+
136
+ [More Information Needed]
137
+
138
+
139
+ #### Training Hyperparameters
140
+
141
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
142
+
143
+ #### Speeds, Sizes, Times [optional]
144
+
145
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
146
+
147
+ [More Information Needed]
148
+
149
+ ## Evaluation
150
+
151
+ <!-- This section describes the evaluation protocols and provides the results. -->
152
+
153
+ ### Testing Data, Factors & Metrics
154
+
155
+ #### Testing Data
156
+
157
+ <!-- This should link to a Data Card if possible. -->
158
+
159
+ [More Information Needed]
160
+
161
+ #### Factors
162
+
163
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
164
+
165
+ [More Information Needed]
166
+
167
+ #### Metrics
168
+
169
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
170
+
171
+ [More Information Needed]
172
+
173
+ ### Results
174
+
175
+ [More Information Needed]
176
+
177
+ #### Summary
178
+
179
+
180
+
181
+ ## Model Examination [optional]
182
+
183
+ <!-- Relevant interpretability work for the model goes here -->
184
+
185
+ [More Information Needed]
186
+
187
+ ## Environmental Impact
188
+
189
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
190
+
191
+ 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).
192
+
193
+ - **Hardware Type:** [More Information Needed]
194
+ - **Hours used:** [More Information Needed]
195
+ - **Cloud Provider:** [More Information Needed]
196
+ - **Compute Region:** [More Information Needed]
197
+ - **Carbon Emitted:** [More Information Needed]
198
+
199
+ ## Technical Specifications [optional]
200
+
201
+ ### Model Architecture and Objective
202
+
203
+ [More Information Needed]
204
+
205
+ ### Compute Infrastructure
206
+
207
+ [More Information Needed]
208
+
209
+ #### Hardware
210
+
211
+ [More Information Needed]
212
+
213
+ #### Software
214
+
215
+ [More Information Needed]
216
+
217
+ ## Citation [optional]
218
+
219
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
220
+
221
+ **BibTeX:**
222
+
223
+ [More Information Needed]
224
+
225
+ **APA:**
226
+
227
+ [More Information Needed]
228
+
229
+ ## Glossary [optional]
230
+
231
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
232
+
233
+ [More Information Needed]
234
+
235
+ ## More Information [optional]
236
+
237
+ [More Information Needed]
238
+
239
+ ## Model Card Authors [optional]
240
+
241
+ [More Information Needed]
242
+
243
+ ## Model Card Contact
244
+
245
+ [More Information Needed]
246
+
247
+