#1165 openai.InternalServerError: Error code: 500 - {'error':

2409:8a55* Posted at: 6 days ago 👁30

配音阶段出错:[ChatterBox TTS] 500 错误: API服务端内部错误 Error code: 500 - {'error': "An internal error occurred: Unsupported language_id 'zh-cn'. Supported languages: ar, da, de, el, en, es, fi, fr, he, hi, it, ja, ko, ms, nl, no, pl, pt, ru, sv, sw, tr, zh"}:
Traceback (most recent call last):
File "videotrans\task\job.py", line 185, in run
File "videotrans\task\_dubbing.py", line 47, in dubbing
File "videotrans\task\_dubbing.py", line 186, in _tts
File "videotrans\tts\__init__.py", line 267, in run
File "videotrans\tts\_base.py", line 193, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\tts\_chatterbox.py", line 48, in _run
File "openai\resources\audio\speech.py", line 103, in create
File "openai\_base_client.py", line 1259, in post
File "openai\_base_client.py", line 1047, in request
openai.InternalServerError: Error code: 500 - {'error': "An internal error occurred: Unsupported language_id 'zh-cn'. Supported languages: ar, da, de, el, en, es, fi, fr, he, hi, it, ja, ko, ms, nl, no, pl, pt, ru, sv, sw, tr, zh"}


=
system:Windows-10-10.0.19045-SP0
version:v3.83
frozen:True
language:zh
root_dir:D:/py 1

2 Replies

您在使用 ChatterBox TTS 配音时遇到了语言代码不兼容的问题。错误信息显示 ChatterBox TTS 不支持 zh-cn 语言代码,只支持 zh

请按以下步骤解决:

  1. 修改语言代码

    • 在软件主界面,找到 目标语言 下拉菜单。
    • 将当前选择的 中文(普通话) 或类似选项,更改为 中文(不带地区标识的选项)。
    • 或者,在 TTS配音设置 菜单中,检查并确保目标语言设置为 zh 而非 zh-cn
  2. 重新开始任务

    • 修改语言设置后,请重新启动配音任务。

如果问题依旧,建议暂时切换到其他 TTS 服务,如 Edge-TTSAzure TTS

打开 chatterbox 里的 api.py文件,找到 lang=data.get('voice','en')改为 lang=data.get('voice','en').split('-')[0]

找到 lang = request.form.get('language','en')改为 lang = request.form.get('language','en').split('-')[0]

Post Your Reply
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.

Donate: https://ko-fi.com/jianchang512

Trending Questions