Skip to main content

fireredtts3-mnn

FireRedTTS3(零样本语音克隆 / 多语言 TTS)的 MNN 部署:ONNX → MNN 分段转换 + int8 权重量化(--weightQuantBits 8),纯 CPU、无 torch 依赖,相比 MNN fp32 基线约 3.6 倍加速。

一键运行(uvx)

uvx fireredtts3-mnn

首次运行自动从 Hugging Face 下载 tokenizer(~11MB)与 MNN w8 权重量化产物(~4.7GB),然后启动 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(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 --weight-quant-bits 8 或 fp32)

注:本机环境 mnnquant(全 int8 激活+权重)C++ 崩溃不可用,当前发布 w8 权重量化版; 若目标环境 mnnquant 可用,可用 make_calib.py 生成校准数据后做全量 int8。

Metadata

Release files for fireredtts3-mnn 0.2.0

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.0
File Size Uploaded
fireredtts3_mnn-0.2.0.tar.gz 12.6 kB Details

Built distribution (wheel)

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

Total release size: 29.1 kB

Release files / fireredtts3_mnn-0.2.0.tar.gz

Download URL fireredtts3_mnn-0.2.0.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
468ab973cfb675e9f2fa3cc4e7a531b50cba5852f3f48a2f72604b35b4a46852
BLAKE2b-256 checksum
How to use checksums
d885927e7ba253aeb9f570f0f6cfbf9f54e94e71706ec9c8d1be73cb78d12070
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.0-py3-none-any.whl

Download URL fireredtts3_mnn-0.2.0-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
04334fbe390d347e7c5bd0b3ef43f6fa2280eccd9b4cd9599c027df745daec31
BLAKE2b-256 checksum
How to use checksums
1d52a5cab0d04f8e4a6a0065140922b3681c69c0698a47ec805f176a9559ec92
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

0.2.1

2 release files

This release

0.2.0 This release

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