Metadata-Version: 2.4
Name: ttsdb_maskgct
Version: 0.1.4
Summary: MaskGCT model for TTSDB
Requires-Python: >=3.10
Requires-Dist: accelerate>=0.24.1
Requires-Dist: cn2an>=0.5.0
Requires-Dist: einops>=0.8.1
Requires-Dist: encodec>=0.1.1
Requires-Dist: g2p-en>=2.1.0
Requires-Dist: huggingface-hub
Requires-Dist: jieba>=0.42.1
Requires-Dist: json5>=0.9.11
Requires-Dist: langsegment-backup==0.3.5.post1
Requires-Dist: librosa>=0.10.0
Requires-Dist: onnxruntime>=1.16.0
Requires-Dist: phonemizer>=3.2.1
Requires-Dist: pykakasi>=2.2.1
Requires-Dist: pyopenjtalk>=0.3.0
Requires-Dist: pypinyin>=0.48.0
Requires-Dist: ruamel-yaml<0.18.0,>=0.17.0
Requires-Dist: safetensors
Requires-Dist: scipy>=1.12.0
Requires-Dist: soundfile
Requires-Dist: torch>=2.0.0
Requires-Dist: torchaudio>=2.0.0
Requires-Dist: tqdm>=4.65.0
Requires-Dist: transformers==4.41.2
Requires-Dist: ttsdb-core>=0.1.0
Requires-Dist: unidecode>=1.3.6
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# MaskGCT

MaskGCT is a zero-shot text-to-speech model using masked generative codec transformer from Amphion.

## Installation

```bash
cd models/maskgct
just setup maskgct
```

## Usage

```python
from ttsdb_maskgct import MaskGCT

model = MaskGCT(model_id="ttsds/maskgct")
audio, sr = model.synthesize(
    text="Hello, world!",
    reference_audio="path/to/reference.wav",
    text_reference="Text spoken in the reference audio.",
    language="en"
)
```

## Audio Examples

Generated audio samples from integration tests:

| Language | Text | Audio |
|----------|------|-------|
| English | "With tenure, Suzie'd have all the more leisure for yachting, but her publications are no good." | [audio_examples/en_test_001.wav](audio_examples/en_test_001.wav) |
| Chinese | "視野無限廣，窗外有藍天" | [audio_examples/zh_test_001.wav](audio_examples/zh_test_001.wav) |

To regenerate examples, run:
```bash
just hf-weights-prepare maskgct  # Download weights first
just test-integration maskgct
```

## Supported Languages

- English (en)
- Chinese (zh)
- Korean (ko)
- Japanese (ja)
- French (fr)
- German (de)

## Citation

```bibtex
@article{wang2024maskgct,
  title={MaskGCT: Zero-Shot Text-to-Speech with Masked Generative Codec Transformer},
  author={Wang, Yuancheng and Zhan, Haoyue and Liu, Liwei and Zeng, Ruihong and Guo, Haotian and Zheng, Jiachen and Zhang, Qiang and Zhang, Xueyao and Zhang, Shunsi and Wu, Zhizheng},
  journal={arXiv preprint arXiv:2409.00750},
  year={2024}
}
```
