That find and replace files in debug-shell is just a quick hack.
You should run your own instance of piper like this:
- Create a
docker-compose.yml
file:
services:
piper:
container_name: piper
image: rhasspy/wyoming-piper:latest
command: --voice fi_FI-myvoice-medium
volumes:
- ./piper:/data
- ./voices.json:/usr/local/lib/python3.9/dist-packages/wyoming_piper/voices.json:ro
restart: always
ports:
- 10200:10200
If due to version change the voices.json
location changes, you need to find the file in the container and use that path instead. It can be done like this (when container is set up):
docker exec -it piper find / -name voices.json
- File
voices.json
must have an entry of your custom voice model (naturally you need to use your files md5 sums and sizes in size_bytes and md5_digest):
{
"fi_FI-myvoice-medium": {
"key": "fi_FI-myvoice-medium",
"name": "myvoice",
"language": {
"code": "fi_FI",
"family": "fi",
"region": "FI",
"name_native": "Suomi",
"name_english": "Finnish",
"country_english": "Finland"
},
"quality": "medium",
"num_speakers": 1,
"speaker_id_map": {},
"files": {
"fi_FI-myvoice-medium.onnx": {
"size_bytes": 12345678,
"md5_digest": "ffffffffffffffffffffffffffffffff"
},
"fi_FI-myvoice-medium.onnx.json": {
"size_bytes": 1234,
"md5_digest": "ffffffffffffffffffffffffffffffff"
},
"MODEL_CARD": {
"size_bytes": 304,
"md5_digest": "95d5aff86d27b69c8ee7deed6c056aff"
}
},
"aliases": []
}
}
I’m not sure is the MODEL_CARD
entry needed, but I just copied it from existing. It doesn’t seem to affect on the result.
- Add your model files (onnx and onnx.json files) to piper dir.
The directory should now look like:
docker-compose.yml
voices.json
piper/fi_FI-myvoice-medium.onnx
piper/fi_FI-myvoice-medium.onnx.json
piper/MODEL_CARD
Then run command
docker-compose up
Finally, add new wyoming-protocol entry with the ip and port of this container.
I don’t understand why changing voices.json isn’t made any easier (or maybe it is, but poorly documented?) IMHO it should first check if /data/voices.json
exists and use that instead. Or merge that with original voices.json
.