adithya-s-k / adithya-s-k/omniparse

OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like vikp/surya_det2 is not the path to a directory containing a file named config.json.

未關閉
#6 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
question
主要語言
Python
星號
7.9k
分支
676
PR 合併指標
30 天內沒有已合併 PR

描述

How do I manually download which specific models from https://huggingface.co/ and in which directory of the specific project

error:
#########################################
conda activate /home/tom/miniconda3/envs/omniparse-venv
(omniparse-venv) root@UBANTU:/home/tom/tomAI/omniparse# python server.py --host 0.0.0.0 --port 8666 --documents --web

.88888. oo 888888ba
d8' `8b 88 `8b
88 88 88d8b.d8b. 88d888b. dP a88aaaa8P' .d8888b. 88d888b. .d8888b. .d8888b.
88 88 88'`88'`88 88' `88 88 88 88' `88 88' `88 Y8ooooo. 88ooood8
Y8. .8P 88 88 88 88 88 88 88 88. .88 88 88 88. ...
`8888P' dP dP dP dP dP dP dP `88888P8 dP `88888P' `88888P'

Created by Adithya S K : https://twitter.com/adithya_s_k

[LOG] ✅ Loading OCR Model
Traceback (most recent call last):
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/urllib3/connection.py", line 196, in _new_conn
sock = connection.create_connection(
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/urllib3/util/connection.py", line 85, in create_connection
raise err
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/urllib3/util/connection.py", line 73, in create_connection
sock.connect(sa)
OSError: [Errno 101] Network is unreachable

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

Traceback (most recent call last):
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 789, in urlopen
response = self._make_request(
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 490, in _make_request
raise new_e
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 466, in _make_request
self._validate_conn(conn)
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1095, in _validate_conn
conn.connect()
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/urllib3/connection.py", line 615, in connect
self.sock = sock = self._new_conn()
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/urllib3/connection.py", line 211, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 101] Network is unreachable

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

Traceback (most recent call last):
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/requests/adapters.py", line 667, in send
resp = conn.urlopen(
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 843, in urlopen
retries = retries.increment(
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 519, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /vikp/surya_det2/resolve/main/config.json (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1722, in _get_metadata_or_catch_error
metadata = get_hf_file_metadata(url=url, proxies=proxies, timeout=etag_timeout, headers=headers)
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1645, in get_hf_file_metadata
r = _request_wrapper(
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 372, in _request_wrapper
response = _request_wrapper(
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 395, in _request_wrapper
response = get_session().request(method=method, url=url, **params)
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/huggingface_hub/utils/_http.py", line 66, in send
return super().send(request, *args, **kwargs)
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/requests/adapters.py", line 700, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /vikp/surya_det2/resolve/main/config.json (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 101] Network is unreachable'))"), '(Request ID: ebf677d7-1daa-4c61-9ce8-52e6c6aaa017)')

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

Traceback (most recent call last):
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/transformers/utils/hub.py", line 402, in cached_file
resolved_file = hf_hub_download(
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1221, in hf_hub_download
return _hf_hub_download_to_cache_dir(
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1325, in _hf_hub_download_to_cache_dir
_raise_on_head_call_error(head_call_error, force_download, local_files_only)
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1826, in _raise_on_head_call_error
raise LocalEntryNotFoundError(
huggingface_hub.utils._errors.LocalEntryNotFoundError: An error happened while trying to locate the file on the Hub and we cannot find the requested files in the local cache. Please check your connection and try again or make sure your Internet connection is on.

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

Traceback (most recent call last):
File "/home/tom/tomAI/omniparse/server.py", line 60, in
main()
File "/home/tom/tomAI/omniparse/server.py", line 46, in main
load_omnimodel(args.documents, args.media, args.web)
File "/home/tom/tomAI/omniparse/omniparse/__init__.py", line 26, in load_omnimodel
shared_state.model_list = load_all_models()
File "/home/tom/tomAI/omniparse/omniparse/documents/models.py", line 68, in load_all_models
detection = setup_detection_model(device, dtype)
File "/home/tom/tomAI/omniparse/omniparse/documents/models.py", line 26, in setup_detection_model
model = segformer.load_model()
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/surya/model/detection/segformer.py", line 23, in load_model
config = SegformerConfig.from_pretrained(checkpoint)
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/transformers/configuration_utils.py", line 603, in from_pretrained
config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/transformers/configuration_utils.py", line 632, in get_config_dict
config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs)
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/transformers/configuration_utils.py", line 689, in _get_config_dict
resolved_config_file = cached_file(
File "/home/tom/miniconda3/envs/omniparse-venv/lib/python3.10/site-packages/transformers/utils/hub.py", line 445, in cached_file
raise EnvironmentError(
OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like vikp/surya_det2 is not the path to a directory containing a file named config.json.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.

貢獻指南

開啟貢獻指南

研究方向

Start with server.py and omniparse/documents/models.py, especially load_all_models and setup_detection_model, then inspect the Surya model-loading call and its vikp/surya_det2 checkpoint. Reproduce the command with the reported network condition and establish which model files and local directory configuration are required for successful startup.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
huggingface, python
領域
machine-learning
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。