lenML / Speech-AI-Forge

🍦 Speech-AI-Forge is a project developed around TTS generation model, implementing an API Server and a Gradio-based WebUI.
https://huggingface.co/spaces/lenML/ChatTTS-Forge
GNU Affero General Public License v3.0
710 stars 87 forks source link

[BUG:API] 文本转语音无报错,但非常的慢,超过120S #148

Closed Ccccx closed 1 month ago

Ccccx commented 1 month ago

确认清单

Forge Commit 或者 Tag

eceb6e971ea0e86e5b644cea7351e7d29a668b60

Python 版本

3.10

PyTorch 版本

2.3.1

操作系统信息

unbuntu 22.04

BUG 描述

使用webui.py启动使用gradio页面进行文本转语音响应11s左右,同样文本内容使用api调用时,api响应需要等待120秒以上(有时直接超时),此时gradio页面点击、刷新均进入阻塞状态,后台服务器资源足够且正常(64G内存,剩余33G,24G显存,剩余13G)。

BUG 端点

/v1/audio/speech

复现参数

启动参数:python webui.py --server_name 0.0.0.0 --server_port 9721 --language zh-CN --api

Web页面只更改了音色,文本内容如下: 黑神话悟空是一款基于西游记的动作冒险游戏,展现出出色的战斗系统和丰富的剧情。游戏的核心战斗方式为劈棍、立棍和戳棍,通过消耗气力进行攻击和防御。[uv_break] 附图: image

API请求参数如下: http://8.130.85.242:9721/v1/audio/speech body: { "model": "chattts", "input": "黑神话悟空是一款基于西游记的动作冒险游戏,展现出出色的战斗系统和丰富的剧情。游戏的核心战斗方式为劈棍、立棍和戳棍,通过消耗气力进行攻击和防御。[uv_break]", "voice": "音色有韵味带磁性", "response_format":"wav", "speed":1, "seed":42, "temperature":0.3, "top_k":20, "top_p":0.7, "style": "", "batch_size":4, "spliter_threshold":100, "eos":"", "enhance": true, "denoise": false }

期望结果

api调用和和web操作响应该相差不大

实际结果

超过120S甚至是超时,在api调用时,web页面进入阻塞(刷新或请求均为反应)

错误信息

无报错,从进度条上时间来看处理很快。阻塞也是发生在这个时候,web页面刷新一直等待中。
2024-09-05 19:22:39,138 - modules.Enhancer.ResembleEnhance - INFO - ResembleEnhance model loaded
100%|███████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00,  1.10steps/s]
zhzLuke96 commented 1 month ago

fixed https://github.com/lenML/ChatTTS-Forge/commit/e775cb127edfbaf9805d92c4bdce69470dffee13

非常感谢这波反馈,帮我们发现了性能问题