freococo commited on
Commit
462c8b9
·
verified ·
1 Parent(s): c4a5bec

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -16
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
- ## Quick Start
76
 
77
- ```python
78
- import torch, soundfile as sf
79
- from huggingface_hub import hf_hub_download
80
- from api import StableTTSAPI
81
- from burmese import burmese_to_ipa2
82
 
83
- # Download model assets
84
- model_path = hf_hub_download("freococo/MyanmarTTS", "model_fp16.pt")
85
- vocos_path = hf_hub_download("freococo/MyanmarTTS", "vocos.pt")
86
- ref_path = hf_hub_download("freococo/MyanmarTTS", "samples/sample_0.wav")
87
 
88
- # Initialize model
89
- model = StableTTSAPI(model_path, vocos_path, "vocos").to("cuda")
90
- model.g2p_mapping["burmese"] = burmese_to_ipa2
91
 
92
  # Inference
93
  text = "လူသားတွေ အားလုံးကို အရမ်း ချစ်ပါတယ်ရှင့်"
94
- audio, _ = model.inference(text, ref_path, "burmese", step=32, solver="dopri5", cfg=3.0)
95
- sf.write("output.wav", audio.squeeze(0).cpu().numpy(), 44100)
 
96
  ```
 
 
 
 
 
 
97
 
98
- > *Translation: "I love all human beings very much." (female polite form)*
 
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