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
6.38k stars 640 forks source link

处理字幕报错:URLError: <urlopen error EOF occurred in violation of protocol (_ssl.c:997)> #250

Open LawrenZzz opened 4 days ago

LawrenZzz commented 4 days ago

在处理字幕时报错如下:

Downloading: "https://download.pytorch.org/torchaudio/models/wav2vec2_fairseq_base_ls960_asr_ls960.pth" to /Users/lawrencez/.cache/torch/hub/checkpoints/wav2vec2_fairseq_base_ls960_asr_ls960.pth WhisperX processing error: <urlopen error EOF occurred in violation of protocol (_ssl.c:997)> 2024-11-11 12:02:42.152 Uncaught app exception Traceback (most recent call last): File "/opt/anaconda3/envs/videolingo/lib/python3.10/urllib/request.py", line 1348, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/opt/anaconda3/envs/videolingo/lib/python3.10/http/client.py", line 1276, in request self._send_request(method, url, body, headers, encode_chunked) File "/opt/anaconda3/envs/videolingo/lib/python3.10/http/client.py", line 1322, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/opt/anaconda3/envs/videolingo/lib/python3.10/http/client.py", line 1271, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/opt/anaconda3/envs/videolingo/lib/python3.10/http/client.py", line 1031, in _send_output self.send(msg) File "/opt/anaconda3/envs/videolingo/lib/python3.10/http/client.py", line 969, in send self.connect() File "/opt/anaconda3/envs/videolingo/lib/python3.10/http/client.py", line 1448, in connect self.sock = self._context.wrap_socket(self.sock, File "/opt/anaconda3/envs/videolingo/lib/python3.10/ssl.py", line 512, in wrap_socket return self.sslsocket_class._create( File "/opt/anaconda3/envs/videolingo/lib/python3.10/ssl.py", line 1070, in _create self.do_handshake() File "/opt/anaconda3/envs/videolingo/lib/python3.10/ssl.py", line 1341, in do_handshake self._sslobj.do_handshake() ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/anaconda3/envs/videolingo/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling result = func() File "/opt/anaconda3/envs/videolingo/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 590, in code_to_exec exec(code, module.dict) File "/Users/lawrencez/Work/VideoLingo/st.py", line 117, in main() File "/Users/lawrencez/Work/VideoLingo/st.py", line 113, in main text_processing_section() File "/Users/lawrencez/Work/VideoLingo/st.py", line 30, in text_processing_section process_text() File "/Users/lawrencez/Work/VideoLingo/st.py", line 45, in process_text step2_whisper.transcribe() File "/Users/lawrencez/Work/VideoLingo/core/step2_whisper.py", line 13, in transcribe ts(video_file) File "/Users/lawrencez/Work/VideoLingo/core/all_whisper_methods/whisperX.py", line 142, in transcribe result = transcribe_audio(audio_file, start, end) File "/Users/lawrencez/Work/VideoLingo/core/all_whisper_methods/whisperX.py", line 94, in transcribe_audio model_a, metadata = whisperx.load_align_model(language_code=result["language"], device=device) File "/Users/lawrencez/Work/VideoLingo/third_party/whisperX/whisperx/alignment.py", line 79, in load_align_model align_model = bundle.get_model(dl_kwargs={"model_dir": model_dir}).to(device) File "/opt/anaconda3/envs/videolingo/lib/python3.10/site-packages/torchaudio/pipelines/_wav2vec2/impl.py", line 92, in get_model state_dict = self._get_state_dict(dl_kwargs) File "/opt/anaconda3/envs/videolingo/lib/python3.10/site-packages/torchaudio/pipelines/_wav2vec2/impl.py", line 169, in _get_state_dict return utils._get_state_dict(self._path, dl_kwargs, self._remove_aux_axis) File "/opt/anaconda3/envs/videolingo/lib/python3.10/site-packages/torchaudio/pipelines/_wav2vec2/utils.py", line 83, in _get_state_dict state_dict = load_state_dict_from_url(url, *dl_kwargs) File "/opt/anaconda3/envs/videolingo/lib/python3.10/site-packages/torch/hub.py", line 766, in load_state_dict_from_url download_url_to_file(url, cached_file, hash_prefix, progress=progress) File "/opt/anaconda3/envs/videolingo/lib/python3.10/site-packages/torch/hub.py", line 620, in download_url_to_file u = urlopen(req) File "/opt/anaconda3/envs/videolingo/lib/python3.10/urllib/request.py", line 216, in urlopen return opener.open(url, data, timeout) File "/opt/anaconda3/envs/videolingo/lib/python3.10/urllib/request.py", line 519, in open response = self._open(req, data) File "/opt/anaconda3/envs/videolingo/lib/python3.10/urllib/request.py", line 536, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "/opt/anaconda3/envs/videolingo/lib/python3.10/urllib/request.py", line 496, in _call_chain result = func(args) File "/opt/anaconda3/envs/videolingo/lib/python3.10/urllib/request.py", line 1391, in https_open return self.do_open(http.client.HTTPSConnection, req, File "/opt/anaconda3/envs/videolingo/lib/python3.10/urllib/request.py", line 1351, in do_open raise URLError(err) urllib.error.URLError: <urlopen error EOF occurred in violation of protocol (_ssl.c:997)>

球球大佬帮我看看这个怎么解决呀~

Huanshere commented 4 days ago

这是下载vad模型的时候网络错误,需要命令行能够访问外网,ping通huggingface,具体可以咨询gpt如何根据你的代理export正确的端口