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

2409**9f99 Posted at: 41 minutes ago

自定义TTS API: Value: 'Same as the voice reference' (type: ) is not in the list of choices: ['与音色参考音频相同', '使用情感参考音频', '使用情感向量控制']
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'rate': '+0%', 'role': 'zh_female_nverguo.wav', 'filename': 'C:\Users\vplei\AppData\Local\Temp/pyvideotrans/36-1795409141.8347754.wav', 'tts_type': 36, 'language': 'zh-cn', 'volume': '+0%', 'pitch': '+0Hz'}
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: ['与音色参考音频相同', '使用情感参考音频', '使用情感向量控制']

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: ['与音色参考音频相同', '使用情感参考音频', '使用情感向量控制']


=
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 41 minutes ago

这是 index-tts 本地服务端(webui.py)多语言字符串翻译不一致导致的校验错误:pyVideoTrans 通过 gradio_client 向 index-tts 提交参数时发送的是英文 Same as the voice reference,而你的 index-tts 服务端当前选项列表是中文 ['与音色参考音频相同', ...],两边对不上就直接报 not in the list of choices。与 pyVideoTrans 本身、参考音频 zh_female_nverguo.wav 无关。

解决步骤:

  1. 打开你本地部署的 index-tts 项目根目录,找到 webui.py。
  2. 在 webui.py 中全局搜索 i18n("与音色参考音频相同")。
  3. 将该处直接替换为英文字符串 Same as the voice reference(不要保留 i18n 包装)。
  4. 保存文件,重启 index-tts 服务(重新运行 api.py / webui.py)。
  5. 回到 pyVideoTrans,重新执行配音任务(必要时勾选 Clear Output 再试)。

注意:你当前使用的 TTS 渠道是「自定义 TTS API」(tts_type=36),它内部同样走 gradio_client 调用 index-tts,因此必须按上述方式修改服务端的 webui.py,而不能只改 pyVideoTrans 的设置。

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