TTS生成问题,求解决

2025-10-06 09:16:04.373 [info] :hourglass_flowing_sand:准备进行文本生成
2025-10-06 09:16:04.373 [info] :hourglass_flowing_sand::arrow_forward:初始化:准备启动
2025-10-06 09:16:14.303 [info] INFO: Started server process [38656]
INFO: Waiting for application startup.

2025-10-06 09:16:14.304 [info] INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:9900 (Press CTRL+C to quit)

2025-10-06 09:16:14.308 [info] :white_check_mark:存在模型
2025-10-06 09:16:14.313 [info]
2025-10-06 09:16:14.313 [info] 准备请求 http:/127.0.0.1:9900/tts/IndexTTS/loadModel {“model_dir”:“g:/3170_AIGC/3174_Applied/ShengHuaBi_HJ/pythonAddon/model/IndexTeam/IndexTTS-1.5”,“cfg_path”:“g:/3170_AIGC/3174_Applied/ShengHuaBi_HJ/pythonAddon/model/IndexTeam/IndexTTS-1.5/config.yaml”,“use_fp16”:true,“use_deepspeed”:false}
2025-10-06 09:16:14.323 [info] INFO: 127.0.0.1:51476 - “POST /tts/IndexTTS/loadModel HTTP/1.1” 200 OK

2025-10-06 09:16:14.328 [info]
2025-10-06 09:16:14.328 [info] 准备请求 http:/127.0.0.1:9900/tts/IndexTTS/text2speech {“audioPath”:“g:/3170_AIGC/3174_Applied/ShengHuaBi_HJ/pythonAddon/reference/女声/chinese/轻快-2025-10-04 16-21-34.wav”,“text”:“启动【solidcenter】”,“options”:{“generation”:{“do_sample”:true,“top_p”:0.8,“top_k”:30,“temperature”:1,“length_penalty”:0,“num_beams”:3,“repetition_penalty”:10,“max_mel_tokens”:1500},“sentence”:{“max_text_tokens_per_segment”:120,“sentences_bucket_max_size”:4}},“output”:“g:/3170_AIGC/3174_Applied/ShengHuaBi_HJ/pythonAddon/chunk/34fbde07-1310-5b4a-a7b3-111e221febb3.wav”}
2025-10-06 09:16:14.332 [info] INFO: 127.0.0.1:51477 - “POST /tts/IndexTTS/text2speech HTTP/1.1” 500 Internal Server Error

2025-10-06 09:16:14.333 [error] Internal Server Error
2025-10-06 09:16:14.337 [info] ERROR: Exception in ASGI application
Traceback (most recent call last):
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py”, line 403, in run_asgi
result = await app( # type: ignore[func-returns-value]
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\uvicorn\middleware\proxy_headers.py”, line 60, in call
return await self.app(scope, receive, send)
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\fastapi\applications.py”, line 1054, in call
await super().call(scope, receive, send)
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\starlette\applications.py”, line 113, in call
await self.middleware_stack(scope, receive, send)
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\starlette\middleware\errors.py”, line 186, in call
raise exc
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\starlette\middleware\errors.py”, line 164, in call
await self.app(scope, receive, _send)
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\starlette\middleware\exceptions.py”, line 63, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\starlette_exception_handler.py”, line 53, in wrapped_app
raise exc
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\starlette_exception_handler.py”, line 42, in wrapped_app
await app(scope, receive, sender)
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\starlette\routing.py”, line 716, in call
await self.middleware_stack(scope, receive, send)
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\starlette\routing.py”, line 736, in app
await route.handle(scope, receive, send)
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\starlette\routing.py”, line 290, in handle
await self.app(scope, receive, send)
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\starlette\routing.py”, line 78, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\starlette_exception_handler.py”, line 53, in wrapped_app
raise exc
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\starlette_exception_handler.py”, line 42, in wrapped_app
await app(scope, receive, sender)
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\starlette\routing.py”, line 75, in app
response = await f(request)
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\fastapi\routing.py”, line 302, in app
raw_response = await run_endpoint_function(
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib.venv\lib\site-packages\fastapi\routing.py”, line 213, in run_endpoint_function
return await dependant.call(**values)
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib\main.py”, line 37, in text2speech
await indexTTS.text2Speech(item.audioPath, item.text, item.options.sentence[‘max_text_tokens_per_segment’], item.options.generation.model_dump(), item.output)
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib\tts\indextts.py”, line 37, in text2Speech
await self.inited
File “g:\3170_AIGC\3174_Applied\ShengHuaBi_HJ\pythonAddon\lib\tts\indextts.py”, line 17, in loadModelAsync
self.tts = IndexTTS(**dict)
TypeError: IndexTTS.init() got an unexpected keyword argument ‘use_deepspeed’

2025-10-06 09:16:14.338 [error] Internal Server Error
2025-10-06 09:16:14.339 [warning] 文本生成失败
2025-10-06 09:16:14.339 [error] [Error: Internal Server Error
at file:///g:/3170_AIGC/3174_Applied/ShengHuaBi/resources/app/extensions/shenghuabi/index.mjs:1784:16089
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async TJ.text2speech (file:///g:/3170_AIGC/3174_Applied/ShengHuaBi/resources/app/extensions/shenghuabi/index.mjs:1784:16360)
at async file:///g:/3170_AIGC/3174_Applied/ShengHuaBi/resources/app/extensions/shenghuabi/index.mjs:1785:1823]
2025-10-06 09:16:14.339 [warning] 出现异常: [Error: Internal Server Error
at file:///g:/3170_AIGC/3174_Applied/ShengHuaBi/resources/app/extensions/shenghuabi/index.mjs:1784:16089
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async TJ.text2speech (file:///g:/3170_AIGC/3174_Applied/ShengHuaBi/resources/app/extensions/shenghuabi/index.mjs:1784:16360)
at async file:///g:/3170_AIGC/3174_Applied/ShengHuaBi/resources/app/extensions/shenghuabi/index.mjs:1785:1823]

1 个赞

您使用的是indextts1.5
没有use_deepspeed这参数,去掉就好了(或者切换到2)

没有参数不是说不能用,而是1.5中是自动判断的,2中是手动的(官方代码)

抱歉.1.101.42版本修复了这问题.
之前看错了以为false不传参数…结果还是传了

这次确实好了,之前发41版本时候忘提交代码直接发布了.尴尬

  • 如果不确定参数是否正确可以看看这里的配置
  • 现在新版使用1.5时候会将use_deepspeed自动删除(不管是否配置)
    "shenghuabi.tts": {
        "backend": "IndexTTS-1.5",
    },
    "shenghuabi.indexTTS": {
        "loadModelParams": {
        }
    },
  • 安装1.101.42后不用重新下载tts及模型

更新好了,可以生成, 感谢指导

1 个赞