Metadata-Version: 2.4
Name: gapiring
Version: 0.1.7
Summary: Uzbek text-to-speech on a CPU: two voices, roles and manners by name, streaming audio
License: Gapiring is open source: free for any use, commercial use included.
        
        1. Code (the runtimes, the libraries, the text normaliser): MIT License
        
        Copyright (c) 2026 Gapi (https://gapi.uz)
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
        documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
        rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
        persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
        Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
        WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
        COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
        OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
        2. Model files, voices and dictionary: Creative Commons Attribution 4.0 International (CC BY 4.0)
           https://creativecommons.org/licenses/by/4.0/
        
        Credit to give when you share them or what you make from them: "Gapiring by Gapi (https://gapi.uz), an adaptation of
        Kyutai Pocket TTS (https://huggingface.co/kyutai/pocket-tts), CC BY 4.0".
        
Keywords: tts,text-to-speech,uzbek,onnx,edge
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
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, in two sizes (Large and Edge). 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! Namuna kompaniyasining virtual yordamchisiman, sizga qanday yordam bera olaman?" --voice f1 --role assistant --manner warm --out hello.wav
```

```python
from gapiring import Gapiring

tts = Gapiring(dictionary=True)        # Large int8, 346 MB; Gapiring("edge", ...) is 117 MB and about 2.5 times faster
tts.save("meeting.wav", "Uchrashuv 25-noyabr soat 14:30 da, to'lov Payme orqali, narxi 1 250 000 so'm.", voice="m1", role="operator", manner="calm")

for chunk in tts.stream("Oyimning tug'ilgan kuniga sovg'a buyurtma qilgandim, [sigh] vaqtida olib kelmadinglar, rosa xafa bo'ldim to'g'risi.", voice="f1", role="emotional", manner="upset"):
    play(chunk)          # float32, 24 kHz mono, the first chunk after about 20 ms on a desktop CPU
```

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

The model files are downloaded from the public repository `islomov/gapi-uz-gapiring-v1` on Hugging Face on first use and
cached; with the files already on disk, pass `Gapiring(path="folder")`.

## Roles and manners

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

There are two assistants. `assistant` is a lively helper: it speaks with a person's intonation and now and then hesitates
a little, as people do in live speech. `assistant_formal` is the same helper in an even, measured delivery: choose it for
announcements, voice menus, instructions, long texts, and wherever every take should sound the same.
`emotional` is a person on the phone speaking with a feeling.

`gapiring manners` prints the same list. Sounds go inside the text: `[laugh]`, `[sigh]`, `[pause]`, `[breath]`.
A text of any length can be given: it is spoken sentence by sentence (the model itself speaks one sentence or a short
paragraph at a time). The apostrophe variants of o' and g' (ʻ, ʼ, ‘, ’) are read as the plain one.

## Text

The text normaliser is on by default (`normalize="literary"`): numbers, dates, times, money, percentages, units and
phone numbers are read out as words and Cyrillic becomes Uzbek Latin; `"conversational"` also uses the Tashkent spoken
forms; `normalize=None` gives the text to the model as written. `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).

Synthesis runs on your machine; after the model is downloaded nothing is sent anywhere. Recent ONNX Runtime builds
report usage to Microsoft by default: this package switches that off (`ORT_DISABLE_TELEMETRY=1`) when it is imported,
so import `gapiring` before `onnxruntime` if you use both. A value you set yourself is left alone.

## Licence

Open source, free for any use, commercial use included. The code is under the MIT licence; the model files, voices and dictionary are under CC BY 4.0 (credit: Gapiring by Gapi, an adaptation of Kyutai Pocket TTS). Full text: `LICENSE`.
