#7928 'str' object has no attribute 'get'Traceback (most recent call last):

188.192**8 Posted at: 1 hour ago

'str' object has no attribute 'get'
Traceback (most recent call last):
File "videotrans\translator\_base.py", line 79, in run
File "videotrans\translator\_base.py", line 117, in _run_text
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 421, in exc_check
tenacity.RetryError: RetryError[]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\task\only_one.py", line 90, in run
File "videotrans\task\_stage_translate.py", line 31, in trans
File "videotrans\translator\_runner.py", line 71, in run
File "videotrans\translator\_base.py", line 85, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_openaicompat.py", line 100, in _item_task
AttributeError: 'str' object has no attribute 'get'

trk=[TransCreate]: uuid='
......
p4,
输出结果保存到文件夹: C:/Private Filez/Videoz/Zum Übertragen/Dubbing/Dubprogress/Mindbrowse com Interview Broadcast “Women In Porn A Discriminating Audience” HD (720p_30fps_H264-128kbit_AAC)-mp4,
临时文件夹: C:/vTrans/tmp/92288/7e32e5e8a6
未选 清理已存在
已启用CUDA加速
已选 降噪
已选 识别说话人,最大说话人数量不限制
STT Service:openai-whisper(Built-in), large-v3-turbo, 发音语言: English,
TranslateSrt:Local LLM (OpenAI-compatible),原始语言:English,目标语言:German, 未选 SendSRT
TTS Service:Confucius4(Built-in), 角色:clone, 配音语言:German, 未选 二次语音识别
音量:-1%, 语速:+0%, 已选 音频加速, 未选 视频慢速
已选 移除每条字幕配音开头和结尾静音缓冲
静音移除力度: default
字幕: No Subtitles
已选 分离人声与背景声, 已选 重新嵌入背景声, 背景音量0.8, 背景声音时长 短于 视频时长时: 拉长(降速播放),存在分离后的纯净人声文件,存在分离后的背景声音文件, precent=12, hasend=False, should_recogn=True, should_trans=True, should_dubbing=True, should_hebing=True, is_copy_video=True, video_codec_num=264, ignore_align=False, is_audio_trans=False, clone_ref='C:/vTrans/tmp/92288/7e32e5e8a6/vocal.wav', should_recogn2=False, do_diarize=True
trk.cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: C:/Private Filez/Videoz/Zum Übertragen/Dubbing/Dubprogress/Mindbrowse com Interview Broadcast “Women In Porn A Discriminating Audience” HD (720p_30fps_H264-128kbit_AAC).mp4,
输出结果保存到文件夹: C:/Private Filez/Videoz/Zum Übertragen/Dubbing/Dubprogress/Mindbrowse com Interview Broadcast “Women In Porn A Discriminating Audience” HD (720p_30fps_H264-128kbit_AAC)-mp4,
临时文件夹: C:/vTrans/tmp/92288/7e32e5e8a6
未选 清理已存在
已启用CUDA加速
已选 降噪
已选 识别说话人,最大说话人数量不限制
STT Service:openai-whisper(Built-in), large-v3-turbo, 发音语言: English,
TranslateSrt:Local LLM (OpenAI-compatible),原始语言:English,目标语言:German, 未选 SendSRT
TTS Service:Confucius4(Built-in), 角色:clone, 配音语言:German, 未选 二次语音识别
音量:-1%, 语速:+0%, 已选 音频加速, 未选 视频慢速
已选 移除每条字幕配音开头和结尾静音缓冲
静音移除力度: default
字幕: No Subtitles
已选 分离人声与背景声, 已选 重新嵌入背景声, 背景音量0.8, 背景声音时长 短于 视频时长时: 拉长(降速播放),存在分离后的纯净人声文件,存在分离后的背景声音文件
video_duration_ms=3866933


=
system:Windows-10-10.0.26300-SP0
version:v4.15
frozen:True
language:en_US
root_dir:C:/vTrans

1 Replies

#1 DeepSeek reply at 1 hour ago

This error is triggered by the Local LLM (OpenAI-compatible) translation channel: the software expects a standard OpenAI‑format JSON response (an object containing choices[0].message.content), but your local LLM service returned a plain string, so calling .get() on it failed → 'str' object has no attribute 'get' (see videotrans/translator/_openaicompat.py line 100). The problem is with the API/endpoint you filled in, not with the video itself.

Fix steps

  1. Verify the API URL is a true OpenAI‑compatible endpoint

    • It must be the Chat Completions API, usually ending with /v1/chat/completions (or /v1).
    • Do NOT fill in a WebUI address (e.g. 7860 / chat page / /chat HTML page). If you filled a WebUI or a proxy page, the software receives HTML/plain text instead of JSON, which produces exactly this error.
  2. Do not use 0.0.0.0

    • Replace any 0.0.0.0 with 127.0.0.1.
  3. Test the endpoint with curl before using it in the software

    curl http://127.0.0.1:端口/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer 你的KEY" -d "{\"model\":\"你的模型名\",\"messages\":[{\"role\":\"user\",\"content\":\"hi\"}]}"
    • Must return JSON containing "choices":[{"message":{"content":"..."}}].
    • If it returns plain text / HTML / a JSON string, this channel cannot be used — switch the service or fix the endpoint.
  4. Confirm the loaded model

    • Must be a pure text chat model. Multimodal / ASR / embedding models, or ASR‑type model names, will not return chat completions and will break the pipeline.
  5. Small local models (≈7B) have weak instruction-following ability

    • They often return non-compliant output. Prefer larger/full models, or use DeepSeek / OpenAI / Gemini for translation.
  6. If the API is OpenAI-compatible, alternatively fill it into the OpenAI / OpenAI Compatible channel

    • The knowledge base explicitly notes: if a third party is OpenAI-compatible, use ChatGPT / OpenAI channel instead of the custom Local LLM entry.
  7. Also, since translation happened before dubbing and the process failed at the translate stage, re-run with 清理已生成 (Clear Output) unchecked only after fixing the API — otherwise it will reuse the cached faulty result. Delete tmp/translate_cache/ if needed.

If the endpoint already returns proper OpenAI JSON via curl but the software still errors, please provide the log bottom ~30 lines from logs/ (latest .log) — include the actual API URL used (mask the key).

请查阅相关文档:

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