Commit ·
68da0f1
1
Parent(s): 95e9e4c
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-sa-4.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-sa-4.0
|
| 3 |
+
datasets:
|
| 4 |
+
- openslr
|
| 5 |
+
- mozilla-foundation/common_voice_13_0
|
| 6 |
+
- Lagos-NWU_Yoruba_Speech_Corpus
|
| 7 |
+
language:
|
| 8 |
+
- yo
|
| 9 |
+
library_name: transformers
|
| 10 |
+
pipeline_tag: text-to-speech
|
| 11 |
---
|
| 12 |
+
|
| 13 |
+
```python
|
| 14 |
+
# Load model directly
|
| 15 |
+
from transformers import SpeechT5Processor, SpeechT5ForTextToSpeech, SpeechT5HifiGan
|
| 16 |
+
from huggingface_hub import hf_hub_download
|
| 17 |
+
import torch
|
| 18 |
+
|
| 19 |
+
processor = SpeechT5Processor.from_pretrained("imhotepai/yoruba-tts")
|
| 20 |
+
model = SpeechT5ForTextToSpeech.from_pretrained("imhotepai/yoruba-tts")
|
| 21 |
+
|
| 22 |
+
dir_= hf_hub_download(repo_id="imhotepai/yoruba-tts", filename="speaker_embeddings.pt")
|
| 23 |
+
speaker_embeddings= torch.load(dir_)
|
| 24 |
+
|
| 25 |
+
text='Báwó ni'.lower()
|
| 26 |
+
inputs = processor(text=text, return_tensors="pt")
|
| 27 |
+
|
| 28 |
+
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")
|
| 29 |
+
speech = model.generate_speech(inputs["input_ids"], speaker_embeddings, vocoder=vocoder)
|
| 30 |
+
|
| 31 |
+
# Audio in notebook
|
| 32 |
+
from IPython.display import Audio
|
| 33 |
+
|
| 34 |
+
Audio(speech.numpy(), rate=16000)
|
| 35 |
+
```
|