Skip to content

Commit 9c3de05

Browse files
committed
📝 docs: 更新README以改善离线搭建指南并添加依赖说明;修复API异常处理信息
1 parent 755b51d commit 9c3de05

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

README.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -148,26 +148,28 @@ ___
148148

149149
### windows离线搭建简略教程
150150

151-
**准备`fish-speech`**
152-
- 1.将`fish-speech` 仓库 `git clone` 至本地
153-
```bash
151+
**使用前**
152+
- [x] [CUDA toolkit](https://developer.nvidia.com/cuda-toolkit) 使用前确保安装正确版本的CUDA
154153

155-
git clone https://github.com/fishaudio/fish-speech
156-
```
157-
- 2.运行`install_env.bat`安装虚拟环境以及所需依赖
158-
- 3.运行`start.bat`初次启动
159-
- 4.修改`API_FLAGS.txt`后再次启动即可
154+
**准备`fish-speech`**
155+
- 1.将`fish-speech` 仓库 [`release`](https://github.com/fishaudio/fish-speech/releases) 的代码(`Source code
156+
(zip)`)下载到本地
157+
- 2.解压到本地
158+
- 3.打开`fish-speech`根目录
159+
- 4.运行`install_env.sh`安装虚拟环境以及所需依赖
160+
- 5.运行`start.bat`初次启动
161+
- 6.修改`API_FLAGS.txt`后再次启动即可
160162

161163
**启动API服务**
162164

163165
- 1.修改`API_FLAGS.txt`大致为以下内容,即取消`api`前面的`#`
164-
```
166+
```bash
165167
# --infer
166168
--api
167169
--listen 0.0.0.0:8080 \ #监听接口
168170
...
169171
```
170-
**`API_FLAGS.txt`里添加额外参数**
172+
**`API_FLAGS.txt`里可添加的额外参数**
171173
- 1.`--complie` ->是否启动编译后的模型 (更快的生成tts,但启动较慢)
172174
- 2.`--workers 数字` ->启动`数字`个多协程 (请务必设置,因为默认一个容易阻塞)
173175
- 3.`--device cpu` ->使用cpu生成tts (如果使用gpu,请忽略)

nonebot_plugin_fishspeech_tts/fish_speech_api.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ async def generate_tts(self, request: ServeTTSRequest) -> bytes:
9999
RequestError,
100100
) as e:
101101
logger.error(f"获取TTS音频失败: {e}")
102-
raise HTTPException("获取TTS音频超时, 你的文本太长啦!") from e
103-
except Exception:
104-
raise APIException("获取TTS音频失败, 检查API后端") from None
102+
raise HTTPException("获取TTS音频超时, 你的接口配置错误或者文本过长") from e
103+
except Exception as e:
104+
raise APIException(f"{e}\n获取TTS音频失败, 检查API后端") from e
105105

106106
def get_speaker_list(self) -> list[str]:
107107
"""

0 commit comments

Comments
 (0)