#8910 自定义TTS API: Value: 'Same as the voice reference' (type: <class 'str'>) is not in the list of choices: ['Same as the voic

2409**9f99 Posted at: 32 minutes ago

自定义TTS API: Value: 'Same as the voice reference' (type: ) is not in the list of choices: ['Same as the voice referenc', '使用情感参考音频', '使用情感向量控制']
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'role': '', 'filename': 'E:/AI/win-pyvideotrans-v4.19/tmp/19112/1795409655.0331478-ttsapi.wav', 'tts_type': 36}
Traceback (most recent call last):
File "videotrans\tts\_ttsapi.py", line 148, in _send
File "gradio_client\client.py", line 498, in predict
File "gradio_client\client.py", line 1483, in result
File "concurrent\futures\_base.py", line 458, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "concurrent\futures\thread.py", line 58, in run
File "gradio_client\client.py", line 1079, in _inner
File "gradio_client\client.py", line 1199, in _predict
gradio_client.exceptions.AppError: Value: 'Same as the voice reference' (type: ) is not in the list of choices: ['Same as the voice referenc', '使用情感参考音频', '使用情感向量控制']

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 23, in run
File "videotrans\tts\__init__.py", line 154, in run
File "videotrans\tts\_base.py", line 98, in run
File "videotrans\tts\_base.py", line 201, in _exec
File "videotrans\tts\_base.py", line 161, in _local_mul_thread
File "videotrans\tts\_base.py", line 216, in _item_task
File "tenacity\__init__.py", line 338, in wrapped_f
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 400, in
File "concurrent\futures\_base.py", line 451, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\tts\_ttsapi.py", line 56, in _run
File "videotrans\tts\_ttsapi.py", line 158, in _send
videotrans.configure.excepts.StopTask: Value: 'Same as the voice reference' (type: ) is not in the list of choices: ['Same as the voice referenc', '使用情感参考音频', '使用情感向量控制']


=
system:Windows-10-10.0.26200-SP0
version:v4.19
frozen:True
language:zh_CN
root_dir:E:/AI/win-pyvideotrans-v4.19

1 Replies

#1 DeepSeek reply at 32 minutes ago

这是本地部署的 Index-TTS WebUI 内部多语言字符串翻译不一致造成的校验错误(选项列表里是被截断的 Same as the voice referenc,而软件发送的是完整的 Same as the voice reference),不是 pyVideoTrans 本身的问题。

解决方式(二选一):

  1. 修改本地 Index-TTS 的 WebUI(推荐)

    1. 打开本地部署的 index-tts 项目根目录下的 webui.py;
    2. 全局搜索字符串 i18n("与音色参考音频相同");
    3. 将其直接替换为纯英文 Same as the voice reference(不加 i18n 包装);
    4. 保存并重启 Index-TTS 服务,再在软件中重试。
  2. 在软件的“自定义 TTS API”设置里,把该参数值改成选项列表中实际存在的字符串,即 使用情感参考音频 或 Same as the voice referenc(注意末尾少一个字母 e,必须与列表完全一致),保存后重试。

补充:若你的 WebUI 是 VoxCPM / FireRedTTS3 等其他 Gradio 界面,同样按“让软件发送的参数值与界面下拉选项完全一致”的原则处理。

Please refer to the related documentation:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Dondate via ko-fi.com

Related resource