Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python download_models_hf.py 报错 #1384

Closed
ybtang21c opened this issue Dec 31, 2024 · 2 comments
Closed

python download_models_hf.py 报错 #1384

ybtang21c opened this issue Dec 31, 2024 · 2 comments
Labels
wontfix This will not be worked on

Comments

@ybtang21c
Copy link

Description of the bug | 错误描述

Traceback (most recent call last):
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
response = self._make_request(
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/connectionpool.py", line 488, in _make_request
raise new_e
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/connectionpool.py", line 464, in _make_request
self._validate_conn(conn)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1093, in _validate_conn
conn.connect()
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/connection.py", line 741, in connect
sock_and_verified = _ssl_wrap_socket_and_match_hostname(
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/connection.py", line 920, in ssl_wrap_socket_and_match_hostname
ssl_sock = ssl_wrap_socket(
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/util/ssl
.py", line 460, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/util/ssl
.py", line 504, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/ssl.py", line 513, in wrap_socket
return self.sslsocket_class._create(
File "/opt/anaconda3/envs/MinerU/lib/python3.10/ssl.py", line 1104, in _create
self.do_handshake()
File "/opt/anaconda3/envs/MinerU/lib/python3.10/ssl.py", line 1375, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 54] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/requests/adapters.py", line 667, in send
resp = conn.urlopen(
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/connectionpool.py", line 841, in urlopen
retries = retries.increment(
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/util/retry.py", line 474, in increment
raise reraise(type(error), error, _stacktrace)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/util/util.py", line 38, in reraise
raise value.with_traceback(tb)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
response = self._make_request(
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/connectionpool.py", line 488, in _make_request
raise new_e
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/connectionpool.py", line 464, in _make_request
self._validate_conn(conn)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1093, in _validate_conn
conn.connect()
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/connection.py", line 741, in connect
sock_and_verified = _ssl_wrap_socket_and_match_hostname(
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/connection.py", line 920, in ssl_wrap_socket_and_match_hostname
ssl_sock = ssl_wrap_socket(
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/util/ssl
.py", line 460, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/urllib3/util/ssl
.py", line 504, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/ssl.py", line 513, in wrap_socket
return self.sslsocket_class._create(
File "/opt/anaconda3/envs/MinerU/lib/python3.10/ssl.py", line 1104, in _create
self.do_handshake()
File "/opt/anaconda3/envs/MinerU/lib/python3.10/ssl.py", line 1375, in do_handshake
self._sslobj.do_handshake()
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/huggingface_hub/_snapshot_download.py", line 155, in snapshot_download
repo_info = api.repo_info(repo_id=repo_id, repo_type=repo_type, revision=revision, token=token)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 2748, in repo_info
return method(
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 2532, in model_info
r = get_session().get(path, headers=headers, timeout=timeout, params=params)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/requests/sessions.py", line 602, in get
return self.request("GET", url, **kwargs)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/huggingface_hub/utils/_http.py", line 93, in send
return super().send(request, *args, **kwargs)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/requests/adapters.py", line 682, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer')), '(Request ID: fef241f7-df02-488a-a754-e6f3d2b5f49a)')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/ybtang21c/Desktop/AEM-textbook-splited/download_models_hf.py", line 43, in
model_dir = snapshot_download('opendatalab/PDF-Extract-Kit-1.0', allow_patterns=mineru_patterns)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "/opt/anaconda3/envs/MinerU/lib/python3.10/site-packages/huggingface_hub/_snapshot_download.py", line 235, in snapshot_download
raise LocalEntryNotFoundError(
huggingface_hub.errors.LocalEntryNotFoundError: An error happened while trying to locate the files on the Hub and we cannot find the appropriate snapshot folder for the specified revision on the local disk. Please check your internet connection and try again.

How to reproduce the bug | 如何复现

python download_models_hf.py

Operating system | 操作系统

MacOS

Python version | Python 版本

3.10

Software version | 软件版本 (magic-pdf --version)

0.10.x

Device mode | 设备模式

cpu

@ybtang21c ybtang21c added the bug Something isn't working label Dec 31, 2024
@myhloli
Copy link
Collaborator

myhloli commented Dec 31, 2024

使用hf下载需要魔法的,国内用modelscope哈

@ybtang21c
Copy link
Author

使用hf下载需要魔法的,国内用modelscope哈

搞定了,非常感谢!

@myhloli myhloli closed this as completed Dec 31, 2024
@dt-yy dt-yy added wontfix This will not be worked on and removed bug Something isn't working labels Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants