Update README.md
Browse files
README.md
CHANGED
|
@@ -24,4 +24,48 @@ language:
|
|
| 24 |
- es
|
| 25 |
- cs
|
| 26 |
pipeline_tag: text-to-speech
|
| 27 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
- es
|
| 25 |
- cs
|
| 26 |
pipeline_tag: text-to-speech
|
| 27 |
+
---
|
| 28 |
+
## Guidelines for Converting Piper ONNX Model
|
| 29 |
+
|
| 30 |
+
**References:**
|
| 31 |
+
* https://github.com/nihui/ncnn-android-piper
|
| 32 |
+
* https://github.com/OHF-Voice/piper1-gpl
|
| 33 |
+
* https://huggingface.co/datasets/rhasspy/piper-checkpoints
|
| 34 |
+
|
| 35 |
+
**Steps to convert Piper checkpoints to NCNN models:**
|
| 36 |
+
|
| 37 |
+
1. **Checkout the correct version of the piper repository:**
|
| 38 |
+
```bash
|
| 39 |
+
git clone [https://github.com/OHF-Voice/piper1-gpl](https://github.com/OHF-Voice/piper1-gpl)
|
| 40 |
+
cd piper1-gpl
|
| 41 |
+
git checkout 113931937cf235fc8all1afd1ca4be209bc6919bc7
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
2. **Apply the necessary patch:**
|
| 45 |
+
```bash
|
| 46 |
+
# Ensure 'piper1-gpl.patch' is available
|
| 47 |
+
git apply piper1-gpl.patch
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
3. **Set up the Python environment and install dependencies:**
|
| 51 |
+
```bash
|
| 52 |
+
python3 -m venv .venv
|
| 53 |
+
source .venv/bin/activate
|
| 54 |
+
python3 -m pip install -e .[train]
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
4. **Download a Piper checkpoint file (`.ckpt`) from Hugging Face:**
|
| 58 |
+
https://huggingface.co/datasets/rhasspy/piper-checkpoints
|
| 59 |
+
|
| 60 |
+
5. **Install the PNNX model converter:**
|
| 61 |
+
```bash
|
| 62 |
+
pip install -U pnnx
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
6. **Obtain the `export_ncnn.py` script.**
|
| 66 |
+
|
| 67 |
+
7. **Run the conversion script on your checkpoint file:**
|
| 68 |
+
```bash
|
| 69 |
+
# Replace with your actual file
|
| 70 |
+
python export_ncnn.py (language code).ckpt (e.g., en.ckpt, fa.ckpt, ...)
|
| 71 |
+
```
|