feat: 支持配置本地模型路径

This commit is contained in:
2026-04-22 16:34:03 +08:00
parent f7c1bed80e
commit e6ae11b7c4
3 changed files with 60 additions and 10 deletions

View File

@@ -30,15 +30,29 @@ pip install -r requirements.txt
### 2. 启动服务
```bash
# 默认端口 12002
# 方式一:自动下载模型
python3 server.py
# 或使用脚本
PORT=12002 ./start.sh
# 方式二:使用已下载的模型(指定路径)
MODEL_PATH=/path/to/ChatTTS python3 server.py
# 方式三:使用本地缓存模型
MODEL_SOURCE=local python3 server.py
```
首次启动会自动下载 ChatTTS 模型(约 2GB
**模型路径配置**
| 环境变量 | 说明 | 示例 |
|---------|------|------|
| `MODEL_PATH` | 模型目录路径 | `/data/models/ChatTTS` |
| `MODEL_SOURCE` | 加载方式 | `auto` / `local` / `download` |
ChatTTS 模型默认下载位置:
- Linux: `~/.cache/modelscope/hub/ChatTTS/`
- 或手动下载后解压到任意目录
### 3. 验证服务
```bash