Metadata-Version: 2.4
Name: xdp-tts-service
Version: 0.1.1
Summary: Standalone TTS Flask service package for XDP
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10,<3.14
Description-Content-Type: text/markdown
Requires-Dist: Flask<4,>=3.0
Requires-Dist: numpy<3,>=1.26
Requires-Dist: openvino>=2025.4.0
Requires-Dist: openvino-tokenizers
Requires-Dist: qwen-tts
Requires-Dist: soundfile<1,>=0.12
Requires-Dist: torch<3,>=2.6
Requires-Dist: transformers<5,>=4.57
Requires-Dist: huggingface-hub<1,>=0.30
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# xdp-tts-service wheel packaging

This directory builds a standalone wheel for the TTS Flask service without changing the monorepo layout.

## What it does

- Copies runtime files from `text_to_speech/` into a temporary staging directory during build.
- Bundles a sanitized config template as `xdp_tts_service/tts_config.example.json`.
- Uses a standalone dependency list for the wheel instead of the full monorepo environment.
- Builds a wheel with CLI entrypoints:
  - `xdp-tts-service`
  - `xdp-tts-init-config`

The temporary staging directory is deleted automatically after build.

## Build

```bash
cd /data1/skill_dev/xDataPrep/xdp_service/tts_service
bash build_tts_service_wheel.sh
```

Wheel will be generated in `dist/`.

## Install

```bash
python3 -m pip install dist/xdp_tts_service-0.1.1-py3-none-any.whl
```

## Initialize config

```bash
xdp-tts-init-config --output ./tts_config.json
```

## Run service

```bash
xdp-tts-service --host 127.0.0.1 --port 5002 --config ./tts_config.json
```

## Notes

- This wheel does not include model weights.
- Generated config uses placeholder model paths. Update them before running.
- `cosyvoice3_0.5b_openvino` is now supported in `tts_config.json`.
- For `cosyvoice3_0.5b_openvino`, set `model_dir/ov_model_dir` to the OpenVINO-exported directory and `original_model_dir` to the original CosyVoice3 model directory.
- The built wheel bundles the CosyVoice3 OpenVINO helper as `text_to_speech/cosyvoice3_ov_helper.py`.
- If the CosyVoice helper is not in the default workspace location, set `XDP_COSYVOICE3_OV_HELPER=/absolute/path/to/ov_cosyvoice_helper.py`.
- If the CosyVoice source repo is not in the default location, set `XDP_COSYVOICE_REPO=/absolute/path/to/CosyVoice`.
- For `qwen3_tts_0.6b_base_openvino`, also set `checkpoint_path` to the original Base PyTorch checkpoint so voice-clone fallback can load the speech tokenizer weights.
- xDataPrep now vendors the Qwen3 OpenVINO helper in `text_to_speech/qwen3_ov_helper.py`.
- The built wheel bundles that vendored helper, so neither source-tree runs nor installed runs need the original notebook helper path.
- Re-run `build_tts_service_wheel.sh` after changing `text_to_speech/*.py`.
- The wheel is intended to be open-source distributable: no workspace-local helper path and no machine-local default model path are bundled anymore.

## Model-Specific Guide

- For a user-facing CosyVoice3 OpenVINO setup and API usage guide, see [README_COSYVOICE3.md](README_COSYVOICE3.md).
