File size: 5,742 Bytes
77433dc
 
 
 
 
 
 
 
 
ed17218
77433dc
 
a807cf1
77433dc
b814c0b
77433dc
a807cf1
 
 
 
 
 
77433dc
a807cf1
77433dc
a807cf1
b814c0b
a807cf1
 
 
 
77433dc
1abfebf
77433dc
 
 
b814c0b
a807cf1
a24d633
 
672f12e
a24d633
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
672f12e
a24d633
 
 
 
 
 
672f12e
a24d633
 
 
 
 
 
 
 
672f12e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a24d633
 
 
 
 
672f12e
 
 
 
 
 
 
a24d633
 
 
 
672f12e
a24d633
a807cf1
 
 
77433dc
672f12e
 
 
 
77433dc
 
a807cf1
77433dc
 
a807cf1
77433dc
 
 
 
 
 
 
 
a807cf1
77433dc
a807cf1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
---
license: mit
pipeline_tag: text-to-speech
library_name: rlx
tags:
- tts
- melotts
- vits2
- rlx
- rlxp
---

# TinyTTS / MeloTTS RLX bundle

MeloTTS/VITS2 English nested `.rlxp` subgraphs + frontend for RLX TinyTTS and MeloTTS. CPU / Metal / MLX / CUDA / wgpu.

| Field | Value |
|---|---|
| **Hub id** | [`eugenehp/tiny-tts-rlx`](https://huggingface.co/eugenehp/tiny-tts-rlx) |
| **Kind** | RLX-native weight bundle (graphs + sidecars ready for `rlx-*` crates). |
| **RLX crate** | [`rlx-tiny-tts`](https://github.com/MIT-RLX/rlx-models/tree/main/crates/rlx-tiny-tts) |
| **Upstream** | https://github.com/tronghieuit/tiny-tts |

## Quick start

```bash
just fetch-tiny-tts   # or: hf download eugenehp/tiny-tts-rlx tiny-tts.rlxp --local-dir weights/tts/tiny-tts-rlx
just fetch-tiny-tts && cargo run -p rlx-tiny-tts --release --features apple-silicon -- --data weights/tts/tiny-tts-rlx --text "Hi." --device metal --out /tmp/tiny.wav
```

## Primary files (use these)

- `tiny-tts.rlxp` β€” 29.4 MiB

## Contents

Hub ships `tiny-tts.rlxp` only (nested graph packs + frontend). Also used by `rlx-melotts` / `just fetch-melotts`. Runtime does **not** load `.onnx` from Hub.

## Pack layout (`.rlxp`)

Outer RLXPFLAT bundle: nested native subgraph packs under `graphs/` (hot weight tensors + graph IR sidecars) plus English frontend assets. No `.onnx` on Hub. `rlx-tiny-tts` materializes the outer pack, then lowers each nested pack to HIR for the utterance length.

Official RLX package format (`RLXPFLAT`, container v2).

```text
[0..8)   magic          RLXPFLAT
[8..12)  version        u32 LE (= 2)
[12..16) flags          u32 LE (hybrid hot/warm/cold)
[16..24) toc_len        u64 LE
[24..)   TOC            JSON table of contents
         data region    64-byte aligned payloads
```

The TOC lists **tensors** (named weight blobs) and/or **sidecars** (files: ONNX,
tokenizers, manifests, …). Sidecars are usually **cold + zstd**; model weights in
tensor packs are **hot + uncompressed** for mmap. Runtime crates open the pack
directly (or materialize sidecars to a temp dir for asset-only packs).

### This pack

| Field | Value |
|---|---|
| **File** | `tiny-tts.rlxp` (29.4 MiB) |
| **Manifest name** | `tiny-tts` |
| **Producer** | `rlx-assets` |
| **Container** | RLXPFLAT v2, flags=0x1 |
| **Tensors** | 0 |
| **Sidecars** | 16 |

### Sidecars (file assets)

Outer TOC is file sidecars only. Neural weights live **inside** each `graphs/<name>.rlxp` as hot mmap tensors (not safetensors).

Paths below are logical ids inside the pack (`__flat__/sidecar/<id>`).
Cold sidecars are zstd-compressed; sizes show raw β†’ stored.

| Sidecar | Raw | Stored | Role |
|---|---:|---:|---|
| `config.json` | 325 B | 220 B | Model / sample-rate config (44.1 kHz) |
| `frontend/bert/tokenizer.json` | 694.7 KiB | 214.5 KiB | BERT WordPiece tokenizer |
| `frontend/bert/tokenizer_config.json` | 351 B | 218 B | Tokenizer config |
| `frontend/cmudict_rep.txt` | 3.9 MiB | 1.0 MiB | CMUdict repair / variants |
| `frontend/g2p_checkpoint.safetensors` | 3.2 MiB | 3.0 MiB | G2P checkpoint |
| `frontend/g2p_cmudict.txt` | 3.3 MiB | 995.6 KiB | CMUdict for G2P |
| `frontend/homographs.en` | 18.3 KiB | 5.0 KiB | Homograph list |
| `frontend/perceptron_tagger.json` | 5.4 MiB | 1.5 MiB | POS tagger |
| `frontend/symbols.json` | 2.1 KiB | 726 B | Symbol table |
| `graphs/decoder.rlxp` | 13.7 MiB | 12.5 MiB | Nested pack: hot tensors + graph.json |
| `graphs/duration_predictor.rlxp` | 1.0 MiB | 598.8 KiB | Nested pack: hot tensors + graph.json |
| `graphs/flow.rlxp` | 13.7 MiB | 8.0 MiB | Nested pack: hot tensors + graph.json |
| `graphs/text_encoder.rlxp` | 2.9 MiB | 1.7 MiB | Nested pack: hot tensors + graph.json |

### Architecture

**Pipeline:** text β†’ English frontend (G2P) β†’ `text_encoder` β†’ `duration_predictor` β†’ monotonic alignment + latent sample (Rust) β†’ `flow` β†’ `decoder` β†’ 44.1 kHz mono WAV.

| Module | Role | Typical dtype | Notes |
|---|---|---|---|
| `text_encoder` | phone/tone/lang β†’ latent | f32 | length = phoneme count `T` |
| `duration_predictor` | per-phone duration | f32 | |
| `flow` | prior / flow | f32 | |
| `decoder` | HiFi-GAN-style vocoder | f32 | ConvTranspose upsample Γ—512 |
| frontend | G2P + BERT tokenizer + CMUdict | β€” | file sidecars |

### Logical tree

```text
tiny-tts.rlxp
β”œβ”€β”€ graphs/
β”‚   β”œβ”€β”€ text_encoder.rlxp      # hot f32/i64 + graph.json
β”‚   β”œβ”€β”€ duration_predictor.rlxp
β”‚   β”œβ”€β”€ flow.rlxp
β”‚   └── decoder.rlxp
β”œβ”€β”€ config.json
└── frontend/                 # G2P / tokenizer (not neural)
```

### How it is packed

`just export-tiny-tts-rlxp` / `pack_rlxp` example: ONNX pack-time source β†’ nested `graphs/*.rlxp` via `rlx-assets` native-pack, then outer bundle. Hub artifact has zero `.onnx`.

## Note

MeloTTS (`rlx-melotts`) loads this same bundle β€” locally `weights/tts/melotts` is a symlink.

## Note

Hub ships **no ONNX**. Nested `graphs/*.rlxp` hold hot f32/i64 tensors + `graph.json`; the crate lowers to HIR per utterance length.

## Run with RLX

Clone [rlx-models](https://github.com/MIT-RLX/rlx-models), place this repo under `weights/tts/tiny-tts-rlx` (or pass the path explicitly), then:

```bash
just fetch-tiny-tts && cargo run -p rlx-tiny-tts --release --features apple-silicon -- --data weights/tts/tiny-tts-rlx --text "Hi." --device metal --out /tmp/tiny.wav
```

## License

MIT β€” see `LICENSE`. Inherit upstream terms when redistributing.

Original weights and authorship: https://github.com/tronghieuit/tiny-tts

## Maintenance

Cards and LFS attrs are regenerated from the local `weights/` tree in [rlx-models](https://github.com/MIT-RLX/rlx-models) via `python3 scripts/prepare_weights_hf.py`.