🐟 支持说话人管理、自动转录和情感控制的高级多语言文本转语音系统
- 🎤 说话人管理 - 注册并重复使用语音配置文件
- 🔄 自动转录 - 使用 Whisper Turbo 自动生成参考文本
- 🌍 多语言支持 - 支持 8+ 种语言(中、英、日、韩、法、德、阿、西)
- 😊 情感控制 - 40+ 种情感和语气标记
- ⚡ GPU 加速 - 支持 CUDA 快速推理
- 🐳 Docker 就绪 - 一键部署
- 📡 REST API - 完整的 FastAPI + Swagger 文档
- 🎨 Web 界面 - 用户友好的 Gradio 界面
docker run -d \
--name fish-speech \
--gpus all \
-p 7864:7864 \
-v $(pwd)/checkpoints:/app/checkpoints \
-v $(pwd)/speakers:/app/speakers \
neosun/fish-speech:all-in-one-v1.2.0访问地址:
- Web 界面:http://localhost:7864
- API 文档:http://localhost:7864/docs
# 克隆仓库
git clone https://github.com/neosun100/fish-speech.git
cd fish-speech
# 安装依赖
pip install -r requirements.txt
# 下载模型
# 将模型放置在 checkpoints/openaudio-s1-mini/ 目录
# 运行服务器
python unified_server.py --port 7864 --device cuda- Python 3.10+
- CUDA 11.8+(GPU 加速)
- Docker 20.10+(Docker 部署)
- 推荐 8GB+ GPU 显存
docker pull neosun/fish-speech:all-in-one-v1.2.0docker run -d \
--name fish-speech-v1.2.0 \
--gpus '"device=0"' \
-p 7864:7864 \
-e PORT=7864 \
-v $(pwd)/checkpoints:/app/checkpoints \
-v $(pwd)/speakers:/app/speakers \
--health-cmd "curl -f http://localhost:7864/health || exit 1" \
--health-interval=30s \
neosun/fish-speech:all-in-one-v1.2.0version: '3.8'
services:
fish-speech:
image: neosun/fish-speech:all-in-one-v1.2.0
container_name: fish-speech
ports:
- "7864:7864"
environment:
- PORT=7864
- DEVICE=cuda
volumes:
- ./checkpoints:/app/checkpoints
- ./speakers:/app/speakers
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7864/health"]
interval: 30s
timeout: 10s
retries: 3运行:docker-compose up -d
| 变量 | 默认值 | 说明 |
|---|---|---|
PORT |
7862 | 服务器端口 |
DEVICE |
cuda | 设备(cuda/cpu) |
COMPILE |
0 | 启用 torch 编译 |
HALF |
0 | 使用半精度 |
LLAMA_CHECKPOINT_PATH |
checkpoints/openaudio-s1-mini | 模型路径 |
/app/checkpoints- 模型文件(必需)/app/speakers- 说话人配置文件(持久化存储)
curl -X POST "http://localhost:7864/api/speakers" \
-F "name=小美" \
-F "description=专业女声" \
-F "audio=@reference.wav"curl -X POST "http://localhost:7864/api/tts/speaker/{speaker_id}" \
-F "text=你好,这是一个测试。" \
-o output.wavcurl -X POST "http://localhost:7864/api/tts" \
-F "text=(excited) 太棒了!(laughing) 哈哈哈!" \
-F "reference_audio=@voice.wav" \
-o emotional_speech.wavcurl -X POST "http://localhost:7864/api/transcribe" \
-F "audio=@audio.wav"| 方法 | 端点 | 说明 |
|---|---|---|
| GET | /health |
健康检查 |
| GET | /api/gpu/status |
GPU 状态 |
| POST | /api/transcribe |
转录音频 |
| GET | /api/speakers |
列出说话人 |
| POST | /api/speakers |
注册说话人 |
| GET | /api/speakers/{id} |
获取说话人 |
| PUT | /api/speakers/{id} |
更新说话人 |
| DELETE | /api/speakers/{id} |
删除说话人 |
| POST | /api/tts |
生成语音 |
| POST | /api/tts/speaker/{id} |
使用说话人生成语音 |
完整 API 文档:http://localhost:7864/docs
fish-speech/
├── unified_server.py # 主服务器
├── gpu_manager.py # GPU 管理
├── fish_speech/ # 核心 TTS 引擎
├── tools/ # 工具集
├── checkpoints/ # 模型文件
├── speakers/ # 说话人配置
├── Dockerfile.allinone # Docker 构建
└── docs/ # 文档
- 框架:FastAPI + Gradio
- 模型:OpenAudio S1-mini(0.5B 参数)
- 转录:Whisper Turbo
- 推理:PyTorch + CUDA
- 部署:Docker + NVIDIA Container Toolkit
欢迎贡献!请遵循以下步骤:
- Fork 本仓库
- 创建特性分支(
git checkout -b feature/AmazingFeature) - 提交更改(
git commit -m 'Add AmazingFeature') - 推送到分支(
git push origin feature/AmazingFeature) - 开启 Pull Request
- ✨ 添加完整的说话人管理系统
- ✨ 支持说话人注册和自动转录
- ✨ 持久化说话人存储
- 📚 完整的 API 文档
- 🐛 修复 Gradio 自动转录 bug
- 🔧 改进音频文件处理
- ✨ 集成 Whisper Turbo
- ✨ 添加转录 API
本项目采用 Apache License 2.0 许可证 - 详见 LICENSE 文件。
模型权重采用 CC-BY-NC-SA-4.0 许可证发布。
用 ❤️ 打造 by Fish Speech 社区
