Instructions to use devendradhakad/autodroid-litert-community-Kokoro-G2P-en-US with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use devendradhakad/autodroid-litert-community-Kokoro-G2P-en-US with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Kokoro G2P (en-US) — LiteRT (preview)
⚠️ Labeled preview — fixed-length
[1, 96], FP32, CPU. Shared to complete the on-device Kokoro front-end per the LiteRT community direction ③.
A LiteRT (.tflite) conversion of DeepPhonemizer en_us_cmudict_forward (a small non-autoregressive forward Transformer), used as the neural grapheme-to-phoneme (G2P) front-end for on-device Kokoro-82M TTS. It gives Kokoro a phonemizer fallback so arbitrary free text — names, brands, numbers — synthesizes with zero dropped words when the dictionary phonemizer misses.
Files
| File | Precision | Size |
|---|---|---|
dp_g2p_litert.tflite |
fp32 | ~51 MB |
Specs
| Task | Grapheme-to-phoneme (English) |
| Source | DeepPhonemizer en_us_cmudict_forward |
| Input | 1 × 96 character IDs (fixed length 96, in-graph padding mask) |
| Output | per-position phoneme logits → ARPABET / IPA |
| Runtime | CPU (LiteRT CompiledModel API) |
| Verified | Pixel 8a — 12/12 vs the reference G2P, no dropped words |
How it was converted / why CPU
- Stock official converter (
litert_torch), static-shape graph: the dynamic-length export hits the same symbolic-sequence-length wall as the TTS model (Shapes must be 1D sequences of concrete values…) — the dynamic-shape converter class. Worked around with a static[1, 96]graph + an in-graph padding mask; converts cleanly and is numerically correct. - CPU-only: the attention's fused-QKV 5-D layout + the mask's
EQUAL/SELECT_V2keep it off the GPU delegate; decomposing the attention to ≤ 4-D would clear that.
Training data
DeepPhonemizer en_us_cmudict_forward is trained on the CMU Pronouncing Dictionary (CMUdict) — ~126k common English words paired with ARPABET pronunciations (a public pronunciation lexicon). It learns the grapheme→phoneme spelling-to-sound mapping only. This LiteRT artifact is a format conversion of the released checkpoint and introduces no additional training data.
PII
No personally identifiable information. CMUdict is a public dictionary of common English word pronunciations (no personal data); none is added during conversion.
Roadmap
- Variable-length + quantized + (ideally) GPU is gated on the dynamic-shape converter work and a ≤ 4-D attention re-author.
Status
Labeled preview — part of an on-device free-text Kokoro-82M LiteRT pipeline; the official litert-samples text_to_speech sample is in review at google-ai-edge/litert-samples #159.
Performance
Measured on an Apple M4 Max, CPU/XNNPACK at 8 threads, ai-edge-litert 2.1.6 — median of 15 warm runs per graph, with zero-filled inputs of each graph's declared static shape. Run-to-run spread stayed within 5%.
| Graph | Warm median | First call |
|---|---|---|
dp_g2p_litert.tflite |
4.4 ms | 9.6 ms |
One call converts a padded 96-character window into per-position phoneme logits, so grapheme-to-phoneme conversion is a rounding error next to the acoustic model and vocoder it feeds.
Android (Pixel 8a)
Android figures use the standard TFLite benchmark_model on a Pixel 8a (Tensor G3, Android 16) — 5 warm-up runs then 20 timed runs, CPU at 4 threads.
| Graph | GPU (OpenCL) | CPU (XNNPACK, 4 threads) |
|---|---|---|
dp_g2p_litert.tflite |
did not run | 43 ms |
1 of these graphs do not load on the OpenCL delegate at all, so the CPU column is the only Android number for them. Nothing here is faster on the GPU; run this pipeline on the CPU on Android.
License
MIT. Full attribution to DeepPhonemizer and the en_us_cmudict_forward checkpoint.
- Downloads last month
- 5