gpt_academic icon indicating copy to clipboard operation
gpt_academic copied to clipboard

[Bug]: 在构建知识库时出错

Open cq134cq opened this issue 11 months ago • 1 comments

Installation Method | 安装方法与平台

Anaconda (I used latest requirements.txt)

Version | 版本

Latest | 最新版

OS | 操作系统

Windows

Describe the bug | 简述

Traceback (most recent call last): File ".\lib\site-packages\urllib3\connection.py", line 198, in _new_conn sock = connection.create_connection( File ".\lib\site-packages\urllib3\util\connection.py", line 85, in create_connection raise err File ".\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection sock.connect(sa) TimeoutError: timed out

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

Traceback (most recent call last): File ".\lib\site-packages\urllib3\connectionpool.py", line 793, in urlopen response = self._make_request( File ".\lib\site-packages\urllib3\connectionpool.py", line 491, in _make_request raise new_e File ".\lib\site-packages\urllib3\connectionpool.py", line 467, in _make_request self._validate_conn(conn) File ".\lib\site-packages\urllib3\connectionpool.py", line 1099, in _validate_conn conn.connect() File ".\lib\site-packages\urllib3\connection.py", line 616, in connect self.sock = sock = self._new_conn() File ".\lib\site-packages\urllib3\connection.py", line 207, in _new_conn raise ConnectTimeoutError( urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x000001E26237D540>, 'Connection to huggingface.co timed out. (connect timeout=10)')

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

Traceback (most recent call last): File ".\lib\site-packages\requests\adapters.py", line 486, in send resp = conn.urlopen( File ".\lib\site-packages\urllib3\connectionpool.py", line 847, in urlopen retries = retries.increment( File ".\lib\site-packages\urllib3\util\retry.py", line 515, 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: /GanymedeNil/text2vec-large-chinese/resolve/main/config.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000001E26237D540>, 'Connection to huggingface.co timed out. (connect timeout=10)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File ".\lib\site-packages\huggingface_hub\file_download.py", line 1238, in hf_hub_download metadata = get_hf_file_metadata( File ".\lib\site-packages\huggingface_hub\utils_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File ".\lib\site-packages\huggingface_hub\file_download.py", line 1631, in get_hf_file_metadata r = _request_wrapper( File ".\lib\site-packages\huggingface_hub\file_download.py", line 385, in _request_wrapper response = _request_wrapper( File ".\lib\site-packages\huggingface_hub\file_download.py", line 408, in _request_wrapper response = get_session().request(method=method, url=url, **params) File ".\lib\site-packages\requests\sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File ".\lib\site-packages\requests\sessions.py", line 703, in send r = adapter.send(request, **kwargs) File ".\lib\site-packages\huggingface_hub\utils_http.py", line 67, in send return super().send(request, *args, **kwargs) File ".\lib\site-packages\requests\adapters.py", line 507, in send raise ConnectTimeout(e, request=request) requests.exceptions.ConnectTimeout: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /GanymedeNil/text2vec-large-chinese/resolve/main/config.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000001E26237D540>, 'Connection to huggingface.co timed out. (connect timeout=10)'))"), '(Request ID: 253798c7-2115-4b21-b5b5-4114ff7c660e)')

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

Traceback (most recent call last): File ".\lib\site-packages\transformers\utils\hub.py", line 398, in cached_file resolved_file = hf_hub_download( File ".\lib\site-packages\huggingface_hub\utils_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File ".\lib\site-packages\huggingface_hub\file_download.py", line 1371, in hf_hub_download 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 ".\toolbox.py", line 191, in decorated yield from f(main_input, llm_kwargs, plugin_kwargs, chatbot_with_cookie, history, *args, **kwargs) File ".\crazy_functions\知识库问答.py", line 66, in 知识库文件注入 HuggingFaceEmbeddings(model_name="GanymedeNil/text2vec-large-chinese") File ".\lib\site-packages\langchain_community\embeddings\huggingface.py", line 67, in init self.client = sentence_transformers.SentenceTransformer( File ".\lib\site-packages\sentence_transformers\SentenceTransformer.py", line 198, in init modules = self._load_auto_model( File ".\lib\site-packages\sentence_transformers\SentenceTransformer.py", line 1063, in _load_auto_model transformer_model = Transformer( File ".\lib\site-packages\sentence_transformers\models\Transformer.py", line 35, in init config = AutoConfig.from_pretrained(model_name_or_path, **model_args, cache_dir=cache_dir) File ".\lib\site-packages\transformers\models\auto\configuration_auto.py", line 1111, in from_pretrained config_dict, unused_kwargs = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs) File ".\lib\site-packages\transformers\configuration_utils.py", line 633, in get_config_dict config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs) File ".\lib\site-packages\transformers\configuration_utils.py", line 688, in _get_config_dict resolved_config_file = cached_file( File ".\lib\site-packages\transformers\utils\hub.py", line 441, 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 GanymedeNil/text2vec-large-chinese 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'.

Screen Shot | 有帮助的截图

C:\soft\ga\lib\site-packages\langchain\vectorstores_init_.py:35: LangChainDeprecationWarning: Importing vector stores from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

from langchain_community.vectorstores import FAISS.

To install langchain-community run pip install -U langchain-community. warnings.warn( C:\soft\ga\lib\site-packages\langchain\document_loaders_init_.py:36: LangChainDeprecationWarning: Importing document loaders from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

from langchain_community.document_loaders import UnstructuredFileLoader.

To install langchain-community run pip install -U langchain-community. warnings.warn( Checking Text2vec ...

Terminal Traceback & Material to Help Reproduce Bugs | 终端traceback(如有) + 帮助我们复现的测试材料样本(如有)

以运行过`pip install -U langchain-community 还是不行

cq134cq avatar Feb 27 '24 08:02 cq134cq

I am facing the similar issue, anyone can support?

Thanks

sdave-connexion avatar Feb 28 '24 22:02 sdave-connexion