Metadata-Version: 2.4
Name: gapiring
Version: 0.1.0
Summary: Uzbek text-to-speech on a CPU: two voices, roles and manners by name, streaming audio
License: Gapiring: licence terms are not published yet. Until they are, all rights are reserved and this package is
        for evaluation by people the authors gave it to.
        
        The models are built on Kyutai Pocket TTS, licensed under CC-BY-4.0.
        
Keywords: tts,text-to-speech,uzbek,onnx,edge
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: onnxruntime>=1.23
Requires-Dist: tokenizers
Requires-Dist: huggingface_hub
Dynamic: license-file

# Gapiring

Uzbek text-to-speech that runs on an ordinary CPU, with no GPU and no server. Two voices (`f1` female, `m1` male), a
**role** and a **manner** of speech by name, including an emotional mode, and audio that streams as it is made.

```bash
pip install gapiring
gapiring say "Assalomu alaykum! Sizga qanday yordam bera olaman?" --voice f1 --role assistant --manner warm --out hello.wav
```

```python
from gapiring import Gapiring

tts = Gapiring("edge", dictionary=True, normalize="literary")
tts.save("order.wav", "Buyurtmangiz 25-noyabr soat 14:30 da yetkaziladi, to'lov Payme orqali.", voice="m1", role="operator", manner="calm")

for chunk in tts.stream("Oyimning tug'ilgan kuniga sovg'a buyurtma qilgandim.", voice="f1", role="emotional", manner="upset"):
    play(chunk)          # float32, 24 kHz mono, the first chunk after about 20 ms on a desktop CPU
```

| | `edge` | `large` |
| --- | --- | --- |
| Transformer layers | 6 | 24 |
| Download | 117 MB (int8) | 346 MB (int8) or 1.3 GB (full precision) |
| Speed, 2 CPU threads | about 10x real time | about 4x real time (int8) |
| For | CPU, phone class devices | server, desktop |

The model files are downloaded from `islomov/gapi-uz-gapiring-v1` on first use and cached. While that repository is private,
set `HF_TOKEN` to a token with access to it.

## Roles and manners

| `role` | `manner` |
| --- | --- |
| `operator` | `neutral` `warm` `cheerful` `empathetic` `calm` `dictation` `persuasive` `brisk` |
| `assistant` | `neutral` `warm` `cheerful` `empathetic` `calm` `dictation` `soothing` |
| `emotional` | `angry` `upset` `irritated` `worried` `tired` `sceptical` `confused` `hurried` `joking` `grateful` `curious` `friendly` `calm` `elderly` |

`gapiring manners` prints the same list. Sounds go inside the text: `[laugh]`, `[sigh]`, `[pause]`, `[breath]`.
Give the model one sentence or a short paragraph per call.

## Text

`normalize="literary"` reads numbers, dates, times, money, percentages, units and phone numbers out as words and
turns Cyrillic into Uzbek Latin; `"conversational"` also uses the Tashkent spoken forms. `dictionary=True` reads English
words, brands and acronyms the Uzbek way (Payme -> Peymi, CRM -> si-ar-em, deadline -> dedlayn); it takes about 4 s and
400 MB to load, so leave it out on small devices when the text has no English. `tts.said(text)` shows the text as the
voice gets it.

Dependencies: numpy, onnxruntime, tokenizers, huggingface_hub. Built on Kyutai Pocket TTS (CC-BY-4.0).
