| --- |
| license: mpl-2.0 |
| language: |
| - en |
| - pt |
| library_name: phoonnx |
| pipeline_tag: text-to-speech |
| tags: |
| - tts |
| - yourtts |
| - vits |
| - onnx |
| - phoonnx |
| - offline |
| - voice-cloning |
| --- |
| |
| # phoonnx-yourtts |
|
|
| Mirror of a YourTTS checkpoint exported to ONNX for |
| [phoonnx](https://github.com/TigreGotico/phoonnx), OpenVoiceOS's offline TTS |
| library. YourTTS is a multilingual VITS conditioned on an external 512-d |
| speaker d-vector rather than a speaker-id embedding, which is what enables |
| zero-shot voice cloning: a reference clip is run through a bundled speaker |
| encoder (`coqui_resnet`) to produce the d-vector that conditions synthesis. |
| See [`phoonnx/engines/yourtts.py`](https://github.com/TigreGotico/phoonnx/blob/dev/phoonnx/engines/yourtts.py) |
| and [docs/cloning.md](https://github.com/TigreGotico/phoonnx/blob/dev/docs/cloning.md). |
|
|
| This is the original multilingual YourTTS model |
| ([Casanova et al., 2022](https://arxiv.org/abs/2112.02418)), trained by Coqui |
| on VCTK (English) and a Brazilian Portuguese corpus, with speaker d-vectors |
| for a fixed set of training speakers exposed as per-speaker config files. |
|
|
| **Note:** unlike the other `phoonnx-*` mirrors, this repository is not |
| currently wired into `phoonnx`'s packaged `voice_index` β there is no |
| `your-tts/*` entry shipped by `update-cache`/`list-voices` yet. The files are |
| present and the `yourtts` engine adapter is implemented and tested; load them |
| by path as shown below until a voice-index entry is published. |
|
|
| ## Contents |
|
|
| - `your-tts/model.onnx` β the shared YourTTS ONNX graph (all speakers below use this one model) |
| - `configs/your-tts-en-spk0.json`, `-spk1.json`, `-spk2.json` β three bundled English (VCTK) training speakers, each with its own d-vector in `engine_params` |
| - `configs/your-tts-pt-spk0.json`, `-spk1.json`, `-spk2.json` β three bundled Brazilian Portuguese training speakers |
|
|
| ## Usage |
|
|
| ```python |
| import wave |
| from huggingface_hub import hf_hub_download |
| from phoonnx.voice import TTSVoice |
| |
| model_path = hf_hub_download("OpenVoiceOS/phoonnx-yourtts", "your-tts/model.onnx") |
| config_path = hf_hub_download("OpenVoiceOS/phoonnx-yourtts", "configs/your-tts-en-spk0.json") |
| |
| voice = TTSVoice.load(model_path, config_path) |
| with wave.open("out.wav", "wb") as wav_file: |
| voice.synthesize_wav("Hello, this is a test.", wav_file) |
| ``` |
|
|
| Zero-shot cloning from your own reference clip (overrides the bundled |
| speaker) works the same way, passing `speaker_reference` to |
| `synthesize_wav` β see |
| [docs/cloning.md](https://github.com/TigreGotico/phoonnx/blob/dev/docs/cloning.md). |
|
|
| ## License |
|
|
| YourTTS's pretrained weights were released by Coqui as part of the |
| `coqui-ai/TTS` model zoo under the MPL-2.0 license, the same license as the |
| Coqui TTS toolkit itself (this predates Coqui's later CPML non-commercial |
| license, introduced with XTTS). `phoonnx` itself is Apache-2.0. |
|
|