CoolFace
Modelpublic

software-mansion/react-native-executorch-kokoro

sourceHugging Faceapache-2.0updated 16d agoView on Hugging Face
2likes104kdownloads
README.md135 linesDownload Raw Back to root
1---2license: apache-2.03language:4- en5- fr6- es7- it8- pt9- de10- pl11- hi12base_model:13- hexgrad/Kokoro-82M14pipeline_tag: text-to-speech15library_name: executorch16---17 18# kokoro19 20This repository hosts the **kokoro** models exported for the21[React Native ExecuTorch](https://www.npmjs.com/package/react-native-executorch)22library as ExecuTorch `.pte` programs, ready to run on device.23 24Upstream model: [Kokoro](https://huggingface.co/hexgrad/Kokoro-82M)25 26## Variants27 28| Path | Component | Backend | Precision |29| --- | --- | --- | --- |30| `coreml/german/duration_predictor_de_coreml_fp32.pte` | duration_predictor | coreml | fp32 |31| `coreml/german/synthesizer_de_coreml_fp32.pte` | synthesizer | coreml | fp32 |32| `coreml/polish/duration_predictor_pl_coreml_fp32.pte` | duration_predictor | coreml | fp32 |33| `coreml/polish/synthesizer_pl_coreml_fp32.pte` | synthesizer | coreml | fp32 |34| `coreml/standard/duration_predictor_std_coreml_fp32.pte` | duration_predictor | coreml | fp32 |35| `coreml/standard/synthesizer_std_coreml_fp32.pte` | synthesizer | coreml | fp32 |36| `xnnpack/german/duration_predictor_de_xnnpack_fp32.pte` | duration_predictor | xnnpack | fp32 |37| `xnnpack/german/synthesizer_de_xnnpack_fp32.pte` | synthesizer | xnnpack | fp32 |38| `xnnpack/polish/duration_predictor_pl_xnnpack_fp32.pte` | duration_predictor | xnnpack | fp32 |39| `xnnpack/polish/synthesizer_pl_xnnpack_fp32.pte` | synthesizer | xnnpack | fp32 |40| `xnnpack/standard/duration_predictor_std_xnnpack_fp32.pte` | duration_predictor | xnnpack | fp32 |41| `xnnpack/standard/synthesizer_std_xnnpack_fp32.pte` | synthesizer | xnnpack | fp32 |42 43## Repository structure44 45```46config.json                                               28 B47coreml/german/config.json                                 2.7 kB48coreml/german/duration_predictor_de_coreml_fp32.pte       64.9 MB49coreml/german/synthesizer_de_coreml_fp32.pte              282 MB50coreml/polish/config.json                                 2.7 kB51coreml/polish/duration_predictor_pl_coreml_fp32.pte       64.9 MB52coreml/polish/synthesizer_pl_coreml_fp32.pte              282 MB53coreml/standard/config.json                               2.7 kB54coreml/standard/duration_predictor_std_coreml_fp32.pte    64.9 MB55coreml/standard/synthesizer_std_coreml_fp32.pte           282 MB56finetunes/kokoro_german_converted.pth                     312 MB57finetunes/kokoro_polish_converted.pth                     312 MB58phonemizer/de/phonemizer_de.pte                           6.8 MB59phonemizer/en-gb/lexicon.json                             6.4 MB60phonemizer/en-gb/phonemizer_en_gb.pte                     6.8 MB61phonemizer/en-gb/tags.json                                2.1 MB62phonemizer/en-us/lexicon.json                             6.0 MB63phonemizer/en-us/phonemizer_en_us.pte                     6.8 MB64phonemizer/en-us/tags.json                                2.1 MB65phonemizer/es/phonemizer_es.pte                           6.8 MB66phonemizer/fr/phonemizer_fr.pte                           6.8 MB67phonemizer/hi/phonemizer_hi.pte                           8.8 MB68phonemizer/it/phonemizer_it.pte                           6.8 MB69phonemizer/pl/phonemizer_pl.pte                           6.8 MB70phonemizer/pt/phonemizer_pt.pte                           6.8 MB71voices/af_heart.bin                                       510 kB72voices/af_river.bin                                       510 kB73voices/af_sarah.bin                                       510 kB74voices/am_adam.bin                                        510 kB75voices/am_michael.bin                                     510 kB76voices/am_santa.bin                                       510 kB77voices/bf_emma.bin                                        510 kB78voices/bm_daniel.bin                                      510 kB79voices/df_anna.bin                                        510 kB80voices/ef_dora.bin                                        510 kB81voices/em_alex.bin                                        510 kB82voices/ff_siwis.bin                                       510 kB83voices/hf_alpha.bin                                       510 kB84voices/hm_omega.bin                                       510 kB85voices/hm_psi.bin                                         510 kB86voices/if_sara.bin                                        510 kB87voices/im_nicola.bin                                      510 kB88voices/jm_kumo.bin                                        510 kB89voices/pf_dora.bin                                        510 kB90voices/pm_mateusz.bin                                     510 kB91voices/pm_santa.bin                                       510 kB92xnnpack/german/config.json                                4.7 kB93xnnpack/german/duration_predictor_de_xnnpack_fp32.pte     56.6 MB94xnnpack/german/synthesizer_de_xnnpack_fp32.pte            260 MB95xnnpack/polish/config.json                                4.7 kB96xnnpack/polish/duration_predictor_pl_xnnpack_fp32.pte     56.6 MB97xnnpack/polish/synthesizer_pl_xnnpack_fp32.pte            260 MB98xnnpack/standard/config.json                              4.7 kB99xnnpack/standard/duration_predictor_std_xnnpack_fp32.pte  56.6 MB100xnnpack/standard/synthesizer_std_xnnpack_fp32.pte         260 MB101```102 103## Compatibility104 105These files are published for the **ExecuTorch v1.4.1** runtime. ExecuTorch106gives no forward compatibility guarantee, so an older runtime may fail to load107them.108 109To use them in React Native ExecuTorch, pass the model constant shipped in the110library's model registry to the corresponding task pipeline. See the111[documentation](https://docs.swmansion.com/react-native-executorch/docs/fundamentals/downloading-models).112 113To load these files in your own ExecuTorch runtime, read the114[compatibility note](https://github.com/pytorch/executorch/blob/main/runtime/COMPATIBILITY.md)115first.116 117## Model details118 119Kokoro synthesizes speech in 8 languages here, including fine-tuned Polish and120German voices. The synthesizer and duration predictor support **input shape121dynamism** over a range of 1 to 128 tokens.122 123Synthesis needs **G2P (grapheme-to-phoneme)** preprocessing, so this124repository also ships the resources for it, not just the voice models:125 126- `phonemizer/` holds the data files for127  [Phonemis](https://github.com/IgorSwat/Phonemis) plus per-language128  word-by-word phonemizer models, themselves in ExecuTorch format.129- `voices/` holds the pre-computed speaker embeddings.130- `xnnpack/` holds one directory per language variant, each with its own131  duration predictor and synthesizer.132 133A worked end-to-end call is in the exporter's134[inference example](https://github.com/NorbertKlockiewicz/kokoro-export/blob/main/demo/inference_example.py).135