Metadata-Version: 2.5
Name: videopython-chatterbox
Version: 0.1.7.post2
Summary: Chatterbox TTS (Resemble AI) with corrected dependency metadata. Includes a short-text alignment fix.
Project-URL: Homepage, https://github.com/BartWojtowicz/videopython-chatterbox
Project-URL: Repository, https://github.com/BartWojtowicz/videopython-chatterbox
Project-URL: Upstream, https://github.com/resemble-ai/chatterbox
Author-email: resemble-ai <engineering@resemble.ai>
Maintainer-email: Bartosz Wójtowicz <bartoszwojtowicz@outlook.com>
License: MIT License
        
        Copyright (c) 2025 Resemble AI
        
        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.
License-File: LICENSE
License-File: NOTICE
Keywords: chatterbox,text-to-speech,tts,voice-cloning
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: conformer>=0.3.2
Requires-Dist: diffusers<1.0,>=0.29.0
Requires-Dist: librosa>=0.11.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: omegaconf
Requires-Dist: pykakasi>=2.3.0
Requires-Dist: pyloudnorm
Requires-Dist: resemble-perth>=1.0.0
Requires-Dist: s3tokenizer
Requires-Dist: safetensors>=0.5.3
Requires-Dist: setuptools<81
Requires-Dist: spacy-pkuseg
Requires-Dist: torch>=2.6.0
Requires-Dist: torchaudio>=2.6.0
Requires-Dist: transformers>=5.2.0
Description-Content-Type: text/markdown

# videopython-chatterbox

[Chatterbox TTS](https://github.com/resemble-ai/chatterbox) by Resemble AI, republished with corrected dependency metadata.

Version 0.1.7.post2 also fixes short-text alignment: repetition detection now
checks that earlier text tokens exist before reducing their attention scores.
Inputs with five or fewer text tokens retain long-tail and token-repetition EOS
checks without raising an empty-reduction error. The distribution-name lookup
and corrected dependency metadata remain the other changes from upstream 0.1.7.

```bash
pip install videopython-chatterbox
```

The import name is unchanged, so this is a drop-in replacement:

```python
from chatterbox.mtl_tts import ChatterboxMultilingualTTS
```

> **Conflict warning:** this package and `chatterbox-tts` both install a top-level
> `chatterbox` package. Install one or the other, never both.

## Why this fork exists

Upstream `chatterbox-tts` 0.1.7 pins `diffusers==0.29.0`, `torch==2.6.0`,
`torchaudio==2.6.0`, `transformers==5.2.0` and `safetensors==0.5.3`. Those `==`
pins make it unsatisfiable alongside any modern ML stack — for example
`pyannote-audio>=4.0` requires `torch>=2.8.0`, so the two cannot coexist:

```console
$ pip install chatterbox-tts diffusers>=0.35.0
  × No solution found: chatterbox-tts==0.1.7 depends on diffusers==0.29.0
```

The pins are not load-bearing. Chatterbox touches diffusers in exactly one
place — its vendored Matcha-TTS decoder — importing 9 symbols (`GEGLU`, `GELU`,
`AdaLayerNorm`, `AdaLayerNormZero`, `ApproximateGELU`, `Attention`,
`LoRACompatibleLinear`, `maybe_allow_in_graph`, `get_activation`). All of them
still exist and behave identically in diffusers 0.39.

## Verification

Real synthesis and voice cloning were run on
**torch 2.13.0 / diffusers 0.39.0 / transformers 5.14.1 / numpy 2.4.6**, then
repeated under upstream's pinned `transformers==5.2.0`, with fixed seeds:

| seed | samples | identical | max abs diff |
|---|---|---|---|
| 1234 | 91200 | yes | 0.0 |
| 1235 | 86400 | yes | 0.0 |
| 1236 | 144000 | yes | 0.0 |

Output is **bit-identical**. Generations were also transcribed with Whisper to
confirm the audio matches the requested text, rather than merely being
non-silent.

## Metadata changes

| dependency | upstream 0.1.7 | here | why |
|---|---|---|---|
| `numpy` | `<2.0.0` (py<3.13) | `>=1.24.0` | verified on 2.4.6 |
| `librosa` | `==0.11.0` | `>=0.11.0` | 0.11.0 is still latest |
| `torch` | `==2.6.0` | `>=2.6.0` | verified on 2.13.0 |
| `torchaudio` | `==2.6.0` | `>=2.6.0` | follows torch |
| `transformers` | `==5.2.0` | `>=5.2.0` | verified bit-identical on 5.14.1 |
| `diffusers` | `==0.29.0` | `>=0.29.0,<1.0` | verified on 0.39.0; see cap below |
| `conformer` | `==0.3.2` | `>=0.3.2` | 0.3.2 is still latest |
| `safetensors` | `==0.5.3` | `>=0.5.3` | verified on 0.8.0 |
| `pykakasi` | `==2.3.0` | `>=2.3.0` | 2.3.0 is still latest |
| `gradio` | `==6.8.0` | *removed* | not imported anywhere in the package |
| `setuptools` | *undeclared* | `<81` | see below |

Two of these are deliberate constraints rather than relaxations:

**`diffusers<1.0`** — `LoRACompatibleLinear` is deprecated with removal
scheduled for diffusers 1.0.0. It is the one symbol that will genuinely break,
so the cap is real.

**`setuptools<81`** — `resemble-perth` declares no dependencies at all and
imports `pkg_resources`, which setuptools removed in 82+. Its `__init__.py`
swallows the resulting `ImportError` and sets `PerthImplicitWatermarker = None`,
so chatterbox fails later at model load with a confusing
`TypeError: 'NoneType' object is not callable`. Upstream is affected by this
too; it is simply undeclared there.

## Relationship to upstream

Changes are limited to packaging compatibility and the documented short-text
alignment crash fix. If upstream incorporates these fixes and relaxes its pins,
prefer `chatterbox-tts`.

To rebase onto a new upstream release: replace `src/chatterbox/` wholesale,
re-apply the distribution-name lookup in `chatterbox/__init__.py`, and check
whether the short-text alignment fix is already present before carrying it forward.
Run `python -m pytest tests/test_short_alignment.py`, verify the remaining source
against the new sdist, bump `version` to `<upstream>.postN`, and re-check the
dependency table above.

For 0.1.7.post2, all seven direct PyTorch tests pass (text widths 1–6 and 20).
GPU synthesis of “za”, “Ja” and a full Polish sentence also succeeded without
videopython's alignment monkeypatch. These checks cover the short-input crash;
they do not establish general speech quality or performance.

## License

MIT, Copyright (c) 2025 Resemble AI — preserved verbatim in [LICENSE](LICENSE).
See [NOTICE](NOTICE) for the fork's provenance statement. Model weights are not
redistributed; they are fetched at runtime from the Hugging Face Hub.
