#6931 Value: 'Same as the voice reference' (type: <class 'str'>) is not in the list of choices: ['与音色参考音频相同', '使用情感参考音频', '使用情

2409:**:911b Posted at: 1 hour ago

Value: 'Same as the voice reference' (type: ) is not in the list of choices: ['与音色参考音频相同', '使用情感参考音频', '使用情感向量控制']:
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'role': '', 'filename': 'D:/win-pyvideotrans/tmp/18288/1787911824.6113467-ttsapi.wav', 'tts_type': 35}
Traceback (most recent call last):
File "videotrans\tts\_ttsapi.py", line 147, 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: ['与音色参考音频相同', '使用情感参考音频', '使用情感向量控制']

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

Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 21, in run
File "videotrans\tts\__init__.py", line 233, in run
File "videotrans\tts\_base.py", line 103, in run
File "videotrans\tts\_base.py", line 206, in _exec
File "videotrans\tts\_base.py", line 166, in _local_mul_thread
File "videotrans\tts\_base.py", line 218, 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 55, in _run
File "videotrans\tts\_ttsapi.py", line 157, in _send
videotrans.configure.excepts.StopTask: Value: 'Same as the voice reference' (type: ) is not in the list of choices: ['与音色参考音频相同', '使用情感参考音频', '使用情感向量控制']


=
system:Windows-10-10.0.19045-SP0
version:v4.11
frozen:True
language:zh
root_dir:D:/win-pyvideotrans

1 Replies

#1 DeepSeek reply at 1 hour ago

该报错是 index-tts 的 Gradio WebUI 接口内部校验不一致导致的:gradio_api.txt 中填写的枚举值 Same as the voice reference 是英文,但该 Index-TTS WebUI 的接口实际接受的选项是中文与音色参考音频相同

解决方案

方法一(推荐):修改你本地部署的 index-tts 项目源码

  1. 打开你本地部署的 index-tts 项目根目录下的 webui.py 文件
  2. 全局搜索字符串 i18n("与音色参考音频相同")
  3. 将其替换为英文 Same as the voice reference
  4. 保存文件并重启 index-tts 服务

方法二:修改软件根目录下的 gradio_api.txt 配置文件

打开软件根目录(D:/win-pyvideotrans)下的 gradio_api.txt,将这一行:

emo_control_method=Same as the voice reference

改为:

emo_control_method=与音色参考音频相同

保存后重试。

注意:若修改后仍报错,请检查 gradio_api.txt 中其他枚举值是否也需与 WebUI 实际选项一致(如 lang_choice 等)。
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