Skip to main content

fireredtts3-mnn

FireRedTTS3(零样本语音克隆 / 多语言 TTS)的 MNN 部署:ONNX → MNN 分段转换 + 混合精度(编码器/解码器/DiT/embed 用 fp16 近无损,backbone 用 w8 权重量化),纯 CPU、无 torch 依赖。

一键运行(uvx)

uvx fireredtts3-mnn

首次运行自动从 Hugging Face 下载 tokenizer(~11MB)与 MNN 混合精度产物(~5.3GB),然后启动 HTTP TTS 服务:

POST /tts
{
  "text": "今天天气很好,我们一起去公园散步吧。",
  "prompt_text": "参考音频对应的文本",
  "prompt_audio_b64": "<参考音频 wav 的 base64>",
  "prompt_audio_sr": 16000,
  "language": "Chinese"        # 可选,默认 Chinese
}
-> {"audio_b64": "<合成 wav base64>", "sample_rate": 24000}

GET /health

单次合成(不启动服务):

uvx fireredtts3-mnn --text "你好世界" --prompt-wav ref.wav --prompt-text "参考文本" --out gen.wav

模型目录

默认缓存到 ~/.cache/fireredtts3-mnn:

  • weights/ 文本 tokenizer(来自 FireRedTeam/FireRedTTS3,运行时为纯 numpy,无需原始权重)
  • mnn/ 转换产物(19 个分段 MNN:campp / redae 编解码 / patch_encoder / dit / 线性头 / embed / norm / prefill_seg1-4 / step_seg1-4,backbone 8.5GB 拆 8 段解决 MNNConvert 无法读 ONNX external data 与 protobuf 2GB 上限)

产物仓库默认 yunfengwang/fireredtts3-mnn(fp16 + w8 混合精度版),可用环境变量覆盖:

export FIREREDTTS3_MNN_REPO="your-hf-account/fireredtts3-mnn"

HF_ENDPOINT 环境变量可走 HF 镜像(hf-mirror.com)。

转换流程(复现)

# 1) PyTorch -> ONNX 分段导出(export_split.py:手写层 _LayerCore + dynamo,opset 18)
# 2) inline 合并(inline_onnx.py,<2GB 内联单文件)
# 3) ONNX -> MNN(convert_mnn.py:小模型 --fp16,backbone 分段 --weight-quant-bits 8)

注:本机环境 mnnquant(全 int8 激活+权重)C++ 崩溃不可用;纯 w8 权重量化对编码器/解码器/DiT 误差过大(prompt latents 最大偏差 1.7),故这些组件发布 fp16(实测偏差 ≤0.08,端到端与 torch 同种子轨迹一致),backbone 分段保持 w8(已验证 stop 轨迹 40 步内与 torch 一致)。

Metadata

Release files for fireredtts3-mnn 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fireredtts3-mnn 0.2.1
File Size Uploaded
fireredtts3_mnn-0.2.1.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fireredtts3-mnn 0.2.1
File Interpreter ABI Platform
fireredtts3_mnn-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 29.3 kB

Release files / fireredtts3_mnn-0.2.1.tar.gz

Download URL fireredtts3_mnn-0.2.1.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
636af23a085009f1a4c05f6727120af2d23ebb349c5380bc6546080ec4a93a61
BLAKE2b-256 checksum
How to use checksums
de8c5bdbab98870f98db0f5cab16e72383359bd2e13ac1c9595313d2fabb7a1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / fireredtts3_mnn-0.2.1-py3-none-any.whl

Download URL fireredtts3_mnn-0.2.1-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28e9d3422d8b0bde2e8c19a8f9614c522b0ac916d60165008a3d1ca7cb9bd554
BLAKE2b-256 checksum
How to use checksums
e38c6e3bb1fe253f5c16ab8ef6980790895559a0959d2d00efb4d450b8a01fb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release history Release notifications | RSS feed

0.2.2

2 release files

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page