Huanshere / Huanshere/VideoLingo

处理字幕过程报错,无法生成字幕文件

Open
#413 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
18.5k
Forks
2k
Avg merge
7h 41m
Merged PRs (30d)
12

Description

配置了LLM,字幕是英文转中文,配音设置custom_tts,下载完所有大语言模型后开始生成字幕,总结的时候会报错
2025-03-01 23:55:38.609 Uncaught app exception
Traceback (most recent call last):
File "D:\AI\Test\VideoLingo\core\ask_gpt.py", line 73, in ask_gpt
response = client.chat.completions.create(**completion_args)
File "C:\Users\haseo.conda\envs\videolingo\lib\site-packages\openai_utils_utils.py", line 275, in wrapper
return func(*args, **kwargs)
File "C:\Users\haseo.conda\envs\videolingo\lib\site-packages\openai\resources\chat\completions.py", line 829, in create
return self._post(
File "C:\Users\haseo.conda\envs\videolingo\lib\site-packages\openai_base_client.py", line 1280, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "C:\Users\haseo.conda\envs\videolingo\lib\site-packages\openai_base_client.py", line 957, in request
return self._request(
File "C:\Users\haseo.conda\envs\videolingo\lib\site-packages\openai_base_client.py", line 1046, in _request
return self._retry_request(
File "C:\Users\haseo.conda\envs\videolingo\lib\site-packages\openai_base_client.py", line 1095, in _retry_request
return self._request(
File "C:\Users\haseo.conda\envs\videolingo\lib\site-packages\openai_base_client.py", line 1046, in _request
return self._retry_request(
File "C:\Users\haseo.conda\envs\videolingo\lib\site-packages\openai_base_client.py", line 1095, in _retry_request
return self._request(
File "C:\Users\haseo.conda\envs\videolingo\lib\site-packages\openai_base_client.py", line 1061, in _request
raise self._make_status_error_from_response(err.response) from None
openai.RateLimitError: Error code: 429 - {'error': {'code': 429, 'message': 'Resource has been exhausted (e.g. check quota).', 'status': 'RESOURCE_EXHAUSTED'}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\haseo.conda\envs\videolingo\lib\site-packages\streamlit\runtime\scriptrunner\exec_code.py", line 88, in exec_func_with_error_handling
result = func()
File "C:\Users\haseo.conda\envs\videolingo\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 590, in code_to_exec
exec(code, module.dict)
File "D:\AI\Test\VideoLingo\st.py", line 124, in
main()
File "D:\AI\Test\VideoLingo\st.py", line 120, in main
text_processing_section()
File "D:\AI\Test\VideoLingo\st.py", line 33, in text_processing_section
process_text()
File "D:\AI\Test\VideoLingo\st.py", line 55, in process_text
step4_2_translate_all.translate_all()
File "D:\AI\Test\VideoLingo\core\step4_2_translate_all.py", line 88, in translate_all
results.append(future.result())
File "C:\Users\haseo.conda\envs\videolingo\lib\concurrent\futures_base.py", line 438, in result
return self.__get_result()
File "C:\Users\haseo.conda\envs\videolingo\lib\concurrent\futures_base.py", line 390, in __get_result
raise self.exception
File "C:\Users\haseo.conda\envs\videolingo\lib\concurrent\futures\thread.py", line 52, in run
result = self.fn(*self.args, *self.kwargs)
File "D:\AI\Test\VideoLingo\core\step4_2_translate_all.py", line 54, in translate_chunk
translation, english_result = translate_lines(chunk, previous_content_prompt, after_content_prompt, things_to_note_prompt, theme_prompt, i)
File "D:\AI\Test\VideoLingo\core\translate_once.py", line 47, in translate_lines
faith_result = retry_translation(prompt1, 'faithfulness')
File "D:\AI\Test\VideoLingo\core\translate_once.py", line 36, in retry_translation
result = ask_gpt(prompt+retry
" ", response_json=True, valid_def=valid_faith, log_title=f'translate
{step_name}')
File "D:\AI\Test\VideoLingo\core\ask_gpt.py", line 105, in ask_gpt
raise Exception(f"Still failed after {max_retries} attempts: {e}")
Exception: Still failed after 3 attempts: Error code: 429 - {'error': {'code': 429, 'message': 'Resource has been exhausted (e.g. check quota).', 'status': 'RESOURCE_EXHAUSTED'}}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading core/ask_gpt.py around the request and retry handling, then trace how failures propagate through core/translate_once.py and core/step4_2_translate_all.py. Reproduce the reported subtitle-translation flow with the shown 429 RESOURCE_EXHAUSTED response. Done means the quota-related failure behavior is handled without the uncaught exception shown in the report.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, streamlit
Domain
ai, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.