直播数字人的GPT-sovits服务
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
fanpt d648d077a6 add --config 17 hours ago
.github Introduce Docker and Windows CI Workflow, Pre-commit Formatting, and Language Resource Auto-Download (#2351) 2 months ago
Docker Introduce Docker and Windows CI Workflow, Pre-commit Formatting, and Language Resource Auto-Download (#2351) 2 months ago
GPT_SoVITS 修复gpt的loss计算问题 (#2537) 3 weeks ago
docs Update Badge (#2518) 4 weeks ago
input 添加女生音频 5 days ago
tools fix: 更正链接 (#2539) 3 weeks ago
.dockerignore Introduce Docker and Windows CI Workflow, Pre-commit Formatting, and Language Resource Auto-Download (#2351) 2 months ago
.gitignore Introduce Docker and Windows CI Workflow, Pre-commit Formatting, and Language Resource Auto-Download (#2351) 2 months ago
.pre-commit-config.yaml Make Pre-Commit-Hook Exit 0 While Using Ruff Check (#2427) 2 months ago
Colab-Inference.ipynb Introduce Docker and Windows CI Workflow, Pre-commit Formatting, and Language Resource Auto-Download (#2351) 2 months ago
Colab-WebUI.ipynb Introduce Docker and Windows CI Workflow, Pre-commit Formatting, and Language Resource Auto-Download (#2351) 2 months ago
Dockerfile Introduce Docker and Windows CI Workflow, Pre-commit Formatting, and Language Resource Auto-Download (#2351) 2 months ago
LICENSE Initial commit 2 years ago
README.md update README.md 2 days ago
README_bac.md update README.md 2 days ago
api.py 语言分割及格式化优化 (#2488) 1 month ago
api_v2.py add --config 17 hours ago
config.py Fix bugs in `install.sh`, reduce log noise, and improve error reporting (#2464) 2 months ago
docker-compose.yaml Fix bugs in `install.sh`, reduce log noise, and improve error reporting (#2464) 2 months ago
docker_build.sh Introduce Docker and Windows CI Workflow, Pre-commit Formatting, and Language Resource Auto-Download (#2351) 2 months ago
extra-req.txt Fix dependency-related issues via requirements update (#2236) 4 months ago
go-webui.bat Introduce Docker and Windows CI Workflow, Pre-commit Formatting, and Language Resource Auto-Download (#2351) 2 months ago
go-webui.ps1 Introduce Docker and Windows CI Workflow, Pre-commit Formatting, and Language Resource Auto-Download (#2351) 2 months ago
gpt-sovits_kaggle.ipynb Colab Infer Fix (#2322) 3 months ago
install.ps1 Add Windows Install Powershell Scripts (#2487) 1 month ago
install.sh Add Windows Install Powershell Scripts (#2487) 1 month ago
requirements.txt fix https://github.com/RVC-Boss/GPT-SoVITS/issues/2402 2 months ago
webui.py Add Distil (#2531) 3 weeks ago

README.md

GPT_SoVITS 服务 README

简要说明

克隆音色并提供实时 TTS Web API可动态切换 GPT/Sovits 权重,支持流式输出。

启动

python api_v2.py -a 0.0.0.0 -p 9880 -c GPT_SoVITS/configs/tts_infer.yaml

后台运行与日志

nohup python api_v2.py -a 0.0.0.0 -p 9880 -c GPT_SoVITS/configs/tts_infer.yaml  > log/gptsovits.log 2>&1 &
tail -n 50 -f log/gptsovits.log

主要接口

1. /tts

合成语音GET/POST成功返回 WAV 流,失败返回 JSON 错误。

必需字段POST 示例):

{
  "text": "要合成的文本",
  "text_lang": "zh",
  "ref_audio_path": "参考音频.wav",
  "prompt_lang": "zh"
}

可选字段有 prompt_textaux_ref_audio_pathsstreaming_modespeed_factor 等。

2. /control

控制服务。command 可为 restartexit

GET 示例:

/control?command=restart

POST 示例:

{ "command": "restart" }

3. /set_gpt_weights

切换 GPT 模型权重:

/set_gpt_weights?weights_path=路径.ckpt

返回 "success" 或错误 JSON。

4. /set_sovits_weights

切换 Sovits 模型权重:

/set_sovits_weights?weights_path=路径.pth

返回 "success" 或错误 JSON。

示例 curl

curl --location --request POST 'http://192.168.10.113:9880/tts' \
--header 'Content-Type: application/json' \
--data-raw '{
    "text": "先帝创业未半而中道崩殂。",
    "text_lang": "zh",
    "ref_audio_path": "input/gentle_girl.wav",
    "prompt_lang": "zh",
    "prompt_text": "刚进直播间的宝子们,左上角先点个关注,点亮咱们家的粉丝灯牌!我是你们的主播陈婉婉,今天给大家准备了超级重磅的福利",
    "media_type": "wav",
    "streaming_mode": false
}'