Skip to content

【错误】使用GEMINI时字幕翻译出错 #85

@AndyLin2020

Description

@AndyLin2020

操作系统

Docker

项目版本

最新

Python版本

No response

错误描述

翻译引擎用Gemini时会出现以下错误,不知道是不是哪里设置错误,首页助手可以正常回答问题:

JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Traceback:
File "/app/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 85, in exec_func_with_error_handling
result = func()
^^^^^^
File "/app/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 576, in code_to_exec
exec(code, module.dict)
File "/app/Chenyme-AAVT.py", line 42, in
pg.run()
File "/app/lib/python3.11/site-packages/streamlit/navigation/page.py", line 291, in run
exec(code, module.dict)
File "/app/page/project/translate.py", line 297, in
result = translate_srt(system_prompt, user_prompt, gemini_key, gemini_url, translate_option, srt_content, wait_time_setting, srt_setting)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/utils/public.py", line 1019, in translate_srt
answer = response.json()
^^^^^^^^^^^^^^^
File "/app/lib/python3.11/site-packages/requests/models.py", line 978, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)

重现步骤

No response

错误截图

No response

其他信息(可选)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions