Files
enginex-mr_series-tts/mr_v100-matcha/README.md
2025-09-15 18:06:51 +08:00

47 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Matcha-TTS
本项目基于 **matcha** 模型封装,提供简洁的 Docker 部署方式,支持 **SSML 输入**,输出 **PCM 原始音频**,可用于语音合成。
---
## Quickstart
### 1. 安装镜像
```bash
docker build -t tts:matcha . -f Dockerfile_matcha
```
其中,基础镜像 corex:4.3.0 通过联系天数智芯智铠100厂商技术支持可获取
### 2. 启动服务
```bash
docker run -it --rm \
-v /models/matcha_model:/mnt/models \
-v /dev:/dev \
--device=/dev/iluvatar0:/dev/iluvatar0 \
-p 8080:80 \
-e MODEL_DIR=/mnt/models \
-e MODEL_NAME=model.ckpt \
tts:matcha
```
参数说明:
- `MODEL_DIR`:模型所在目录(挂载到容器内 `/mnt/models`
- `MODEL_NAME`:加载的模型文件名(通常为 `.safetensors`
- `-p 8080:80`:将容器内服务端口映射到宿主机 `8080`
- `--device=/dev/iluvatar0:/dev/iluvatar0`:指定推理设备(如 GPU/加速卡)
### 3. 测试服务
```bash
curl --request POST "http://localhost:8080/tts" \
--header 'Content-Type: application/ssml+xml' \
--header 'User-Agent: curl' \
--data-raw '<speak version="1.0" xml:lang="zh">
<voice xml:lang="zh" xml:gender="Female" name="zh">
今天天气很好,不知道明天天气怎么样。
</voice>
</speak>' \
--output sound.pcm
```
---