snsbhg commited on
Commit
43aece8
·
verified ·
1 Parent(s): af32b85

Upload 3 files

Browse files
Files changed (2) hide show
  1. README.md +4 -76
  2. download_support_models.py +0 -1
README.md CHANGED
@@ -10,79 +10,7 @@ license: mit
10
 
11
  # GPT‑SoVITS v2 ProPlus — REST API for AstrBot (Docker Space)
12
 
13
- 这个 Space 已经为 **AstrBot** 的 `astrbot_plugin_GPT_SoVITS` 插件准备好了一个 **REST API 服务端 (api_v2.py)**。
14
- 你只需把 **你现成的模型权重 + 参考音频** 放到下列路径,然后点击 **Restart and rebuild** 即可。
15
-
16
- ## 放置你的文件(请先重命名,避免中文/空格/加号等字符)
17
-
18
- - **GPT 权重(.ckpt)** → `weights/shantianliang_proplus_e32.ckpt`
19
- (把你本地的 `shantianliangPROpius-e32.ckpt` 改名为上面这个)
20
-
21
- - **SoVITS 权重(.pth)** → `weights/shantianliang_proplus_e8_s192.pth`
22
- (把你本地的 `shantianliangPRO+_e8_s192.pth` 改名为上面这个)
23
-
24
- - **参考音频(.wav)** → `reference_audio/ref_shantianliang_1.wav`
25
- (把你本地的 `山田凉参考音频1.wav` 改名为上面这个)
26
-
27
- > 你现在看到的 `reference_audio/ref_shantianliang_1.wav` 是一个 **占位的静音文件**,用来保证服务能启动。请用你的真实参考音频替换。
28
-
29
- ## 启动后的测试
30
-
31
- - **切 SoVITS 权重**
32
- ```bash
33
- curl -G "https://<你的空间>.hf.space/set_sovits_weights" --data-urlencode "weights_path=/app/pretrained_models/shantianliang/shantianliang_proplus_e8_s192.pth"
34
- ```
35
-
36
- - **切 GPT 权重**
37
- ```bash
38
- curl -G "https://<你的空间>.hf.space/set_gpt_weights" --data-urlencode "weights_path=/app/pretrained_models/shantianliang/shantianliang_proplus_e32.ckpt"
39
- ```
40
-
41
- - **合成 TTS(POST,推荐)**
42
- ```bash
43
- curl -L "https://<你的空间>.hf.space/tts" -H "Content-Type: application/json" -d '{
44
- "text": "今天来测试一下山田凉的声音,欢迎收听。",
45
- "text_lang": "zh",
46
- "ref_audio_path": "/app/reference_audio/ref_shantianliang_1.wav",
47
- "prompt_lang": "zh",
48
- "prompt_text": "这是山田凉的参考音频",
49
- "media_type": "wav",
50
- "streaming_mode": false
51
- }' -o out.wav
52
- ```
53
-
54
- - **流式(边播边收)**
55
- ```bash
56
- curl -N -L "https://<你的空间>.hf.space/tts?text=流式测试&text_lang=zh&ref_audio_path=/app/reference_audio/ref_shantianliang_1.wav&prompt_lang=zh&prompt_text=参考提示&media_type=wav&streaming_mode=true" -o stream.wav
57
- ```
58
-
59
- > 以上接口与参数来自 `api_v2.py`。记得把 `<你的空间>` 换成实际 Space 名称。
60
-
61
- ## AstrBot 插件如何填
62
-
63
- 在 AstrBot 的 **astrbot_plugin_GPT_SoVITS** 插件配置里:
64
- - **base_url**:`https://<你的空间>.hf.space`
65
- - **gpt_weights_path**:`/app/pretrained_models/shantianliang/shantianliang_proplus_e32.ckpt`
66
- - **sovits_weights_path**:`/app/pretrained_models/shantianliang/shantianliang_proplus_e8_s192.pth`
67
-
68
- 然后就可以用插件的命令(如 `/说 你好`、`/生气地说 ...`)或自动触发来合成语音了。
69
-
70
- ## 目录结构(上传前)
71
-
72
- ```
73
- /
74
- ├─ Dockerfile
75
- ├─ download_support_models.py
76
- ├─ README.md
77
- ├─ weights/
78
- │ ├─ shantianliang_proplus_e32.ckpt # ← 放你的 GPT 权重(改名后)
79
- │ └─ shantianliang_proplus_e8_s192.pth # ← 放你的 SoVITS 权重(改名后)
80
- └─ reference_audio/
81
- └─ ref_shantianliang_1.wav # ← 放你的参考音频(改名后,已提供静音占位)
82
- ```
83
-
84
- ## 常见问题
85
-
86
- - 如果报 **400** 且提示缺少参数,请检查 `/tts` 的必填字段:`text`、`text_lang`、`ref_audio_path`、`prompt_lang`。
87
- - `ref_audio_path` 一定要是服务端的**本地路径**(例如 `/app/reference_audio/...`)。
88
- - Hugging Face **Docker Space 监听端口**为 `7860`(本仓库已固定)。
 
10
 
11
  # GPT‑SoVITS v2 ProPlus — REST API for AstrBot (Docker Space)
12
 
13
+ ## 放置你的文件(统一命名,避免中文/空格/加号)
14
+ - GPT 权重 `weights/shantianliang_proplus_e32.ckpt`
15
+ - SoVITS 权重 → `weights/shantianliang_proplus_e8_s192.pth`
16
+ - 参考音频 → `reference_audio/ref_shantianliang_1.wav`(当前是 1 秒静音占位,请替换)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
download_support_models.py CHANGED
@@ -4,7 +4,6 @@ import os
4
  target = "pretrained_models"
5
  os.makedirs(target, exist_ok=True)
6
 
7
- # Download speech encoders and Chinese frontends (kept small; add more as needed)
8
  try:
9
  snapshot_download(
10
  repo_id="lj1995/GPT-SoVITS",
 
4
  target = "pretrained_models"
5
  os.makedirs(target, exist_ok=True)
6
 
 
7
  try:
8
  snapshot_download(
9
  repo_id="lj1995/GPT-SoVITS",