Update README.md
Browse files
README.md
CHANGED
|
@@ -72,30 +72,32 @@ The reference voice used for voice cloning during inference:
|
|
| 72 |
|
| 73 |
<audio controls src="https://huggingface.co/freococo/MyanmarTTS/resolve/main/samples/sample_0.wav"></audio>
|
| 74 |
|
| 75 |
-
#
|
| 76 |
|
| 77 |
-
```
|
| 78 |
-
|
| 79 |
-
from huggingface_hub import hf_hub_download
|
| 80 |
-
from api import StableTTSAPI
|
| 81 |
-
from burmese import burmese_to_ipa2
|
| 82 |
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
vocos_path = hf_hub_download("freococo/MyanmarTTS", "vocos.pt")
|
| 86 |
-
ref_path = hf_hub_download("freococo/MyanmarTTS", "samples/sample_0.wav")
|
| 87 |
|
| 88 |
-
#
|
| 89 |
-
|
| 90 |
-
model.g2p_mapping["burmese"] = burmese_to_ipa2
|
| 91 |
|
| 92 |
# Inference
|
| 93 |
text = "လူသားတွေ အားလုံးကို အရမ်း ချစ်ပါတယ်ရှင့်"
|
| 94 |
-
audio
|
| 95 |
-
|
|
|
|
| 96 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
-
|
|
|
|
| 99 |
|
| 100 |
---
|
| 101 |
|
|
|
|
| 72 |
|
| 73 |
<audio controls src="https://huggingface.co/freococo/MyanmarTTS/resolve/main/samples/sample_0.wav"></audio>
|
| 74 |
|
| 75 |
+
# Quick Start
|
| 76 |
|
| 77 |
+
```bash
|
| 78 |
+
pip install myanmartts
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
+
import soundfile as sf
|
| 81 |
+
from myanmar_tts import MyanmarTTS
|
|
|
|
|
|
|
| 82 |
|
| 83 |
+
# Load model (auto-downloads from HuggingFace on first run)
|
| 84 |
+
tts = MyanmarTTS(device="cuda")
|
|
|
|
| 85 |
|
| 86 |
# Inference
|
| 87 |
text = "လူသားတွေ အားလုံးကို အရမ်း ချစ်ပါတယ်ရှင့်"
|
| 88 |
+
audio = tts.tts(text, solver="euler", step=32, cfg=3.0)
|
| 89 |
+
|
| 90 |
+
sf.write("output.wav", audio, 44100)
|
| 91 |
```
|
| 92 |
+
- *Translation: "I love all human beings very much." (female polite form)*
|
| 93 |
+
|
| 94 |
+
# Advanced
|
| 95 |
+
|
| 96 |
+
*Faster (slightly lower quality)*
|
| 97 |
+
audio = tts.tts(text, step=8)
|
| 98 |
|
| 99 |
+
*Higher quality*
|
| 100 |
+
audio = tts.tts(text, step=24)
|
| 101 |
|
| 102 |
---
|
| 103 |
|