Huanshere / VideoLingo

Netflix-level subtitle cutting, translation, alignment, and even dubbing - one-click fully automated AI video subtitle team | Netflix级字幕切割、翻译、对齐、甚至加上配音,一键全自动视频搬运AI字幕组
https://docs.videolingo.io
Apache License 2.0
7.01k stars 683 forks source link

用不同的本地部署(`ollama` based)的语言模型分割句子时报错均不同 #262

Closed bwnjnOEI closed 1 week ago

bwnjnOEI commented 1 week ago

qwen2.5:7b

image

llama3.1:8b-instruct-q8_0

image

gemma2:9bqwen2.5:32b 分割句子正常,但摘要时报错:

2024-11-15 01:06:18.490 Uncaught app exception
Traceback (most recent call last):
  File "/home/bwnjnoei/Workspace/VideoLingo/core/ask_gpt.py", line 82, in ask_gpt
    raise ValueError(f"❎ API response error: {valid_response['message']}")
ValueError: ❎ API response error: Invalid response format

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/bwnjnoei/Workspace/VideoLingo/core/ask_gpt.py", line 90, in ask_gpt
    raise Exception(f"JSON parsing still failed after {max_retries} attempts: {e}\n Please check your network connection or API key or `output/gpt_log/error.json` to debug.")
Exception: JSON parsing still failed after 3 attempts: ❎ API response error: Invalid response format
 Please check your network connection or API key or `output/gpt_log/error.json` to debug.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/bwnjnoei/miniforge3/envs/videolingo/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
    result = func()
  File "/home/bwnjnoei/miniforge3/envs/videolingo/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 590, in code_to_exec
    exec(code, module.__dict__)
  File "/home/bwnjnoei/Workspace/VideoLingo/st.py", line 116, in <module>
    main()
  File "/home/bwnjnoei/Workspace/VideoLingo/st.py", line 112, in main
    text_processing_section()
  File "/home/bwnjnoei/Workspace/VideoLingo/st.py", line 30, in text_processing_section
    process_text()
  File "/home/bwnjnoei/Workspace/VideoLingo/st.py", line 49, in process_text
    step4_1_summarize.get_summary()
  File "/home/bwnjnoei/Workspace/VideoLingo/core/step4_1_summarize.py", line 47, in get_summary
    summary = ask_gpt(summary_prompt, response_json=True, valid_def=valid_summary, log_title='summary')
  File "/home/bwnjnoei/Workspace/VideoLingo/core/ask_gpt.py", line 103, in ask_gpt
    raise Exception(f"Still failed after {max_retries} attempts: {e}")
Exception: Still failed after 3 attempts: JSON parsing still failed after 3 attempts: ❎ API response error: Invalid response format
 Please check your network connection or API key or `output/gpt_log/error.json` to debug.
bwnjnOEI commented 1 week ago

浏览了一些issue还是决定回去用pyvideotrans了,不过浪费了1个多小时折腾。

Huanshere commented 5 days ago

估计是上下文窗口太长了导致ollama本地运行报错