2024-12-08 16:54:44,607 - utils.py[line:197] - ERROR: RemoteProtocolError: API通信遇到错误:peer closed connection without sending complete message body (incomplete chunked read) #5128
Labels
bug
Something isn't working
调用大模型没问题,但是导入知识库后,当开始知识库问答的时候,会报如下的错误:
-----------------model path------------------
bge-reranker-large path : BAAI/bge-reranker-large
d:\py\Anaconda3\envs\chatchat\Lib\site-packages\huggingface_hub\file_download.py:1142: FutureWarning:
resume_download
is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, useforce_download=True
.warnings.warn(
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\sse_starlette\sse.py", line 269, in call
await wrap(partial(self.listen_for_disconnect, receive))
File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\sse_starlette\sse.py", line 258, in wrap
await func()
File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\sse_starlette\sse.py", line 215, in listen_for_disconnect
message = await receive()
^^^^^^^^^^^^^^^
File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 531, in receive
await self.message_event.wait()
File "d:\py\Anaconda3\envs\chatchat\Lib\asyncio\locks.py", line 213, in wait
await fut
asyncio.exceptions.CancelledError: Cancelled by cancel scope 23deef85590
During handling of the above exception, another exception occurred:
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 403, in run_asgi
| result = await app( # type: ignore[func-returns-value]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 60, in call
| return await self.app(scope, receive, send)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\fastapi\applications.py", line 1054, in call
| await super().call(scope, receive, send)
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\starlette\applications.py", line 119, in call
| await self.middleware_stack(scope, receive, send)
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\starlette\middleware\errors.py", line 186, in call
| raise exc
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\starlette\middleware\errors.py", line 164, in call
| await self.app(scope, receive, _send)
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\starlette\middleware\exceptions.py", line 62, in call
| await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\starlette_exception_handler.py", line 64, in wrapped_app
| raise exc
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
| await app(scope, receive, sender)
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\starlette\routing.py", line 762, in call
| await self.middleware_stack(scope, receive, send)
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\starlette\routing.py", line 782, in app
| await route.handle(scope, receive, send)
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\starlette\routing.py", line 297, in handle
| await self.app(scope, receive, send)
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\starlette\routing.py", line 77, in app
| await wrap_app_handling_exceptions(app, request)(scope, receive, send)
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\starlette_exception_handler.py", line 64, in wrapped_app
| raise exc
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
| await app(scope, receive, sender)
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\starlette\routing.py", line 75, in app
| await response(scope, receive, send)
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\sse_starlette\sse.py", line 255, in call
| async with anyio.create_task_group() as task_group:
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\anyio_backends_asyncio.py", line 815, in aexit
| raise BaseExceptionGroup(
| ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\urllib3\connection.py", line 199, in _new_conn
| sock = connection.create_connection(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\urllib3\util\connection.py", line 85, in create_connection
| raise err
| File "d:\py\Anaconda3\envs\chatchat\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 "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\urllib3\connectionpool.py", line 789, in urlopen
| response = self._make_request(
| ^^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\urllib3\connectionpool.py", line 490, in _make_request
| raise new_e
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\urllib3\connectionpool.py", line 466, in _make_request
| self._validate_conn(conn)
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\urllib3\connectionpool.py", line 1095, in _validate_conn
| conn.connect()
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\urllib3\connection.py", line 693, in connect
| self.sock = sock = self._new_conn()
| ^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\urllib3\connection.py", line 208, in _new_conn
| raise ConnectTimeoutError(
| urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x0000023DEDD9D790>, '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 "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\requests\adapters.py", line 486, in send
| resp = conn.urlopen(
| ^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\urllib3\connectionpool.py", line 843, in urlopen
| retries = retries.increment(
| ^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\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: /BAAI/bge-reranker-large/resolve/main/config.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000023DEDD9D790>, 'Connection to huggingface.co timed out. (connect timeout=10)'))
|
| During handling of the above exception, another exception occurred:
|
| Traceback (most recent call last):
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\huggingface_hub\file_download.py", line 1746, in _get_metadata_or_catch_error
| metadata = get_hf_file_metadata(
| ^^^^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
| return fn(*args, **kwargs)
| ^^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\huggingface_hub\file_download.py", line 1666, in get_hf_file_metadata
| r = _request_wrapper(
| ^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\huggingface_hub\file_download.py", line 364, in _request_wrapper
| response = _request_wrapper(
| ^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\huggingface_hub\file_download.py", line 387, in _request_wrapper
| response = get_session().request(method=method, url=url, **params)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\requests\sessions.py", line 589, in request
| resp = self.send(prep, **send_kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\requests\sessions.py", line 703, in send
| r = adapter.send(request, **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\huggingface_hub\utils_http.py", line 93, in send
| return super().send(request, *args, **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\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: /BAAI/bge-reranker-large/resolve/main/config.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000023DEDD9D790>, 'Connection to huggingface.co timed out. (connect timeout=10)'))"), '(Request ID: 8a4d805c-13b7-4dfb-9abd-9e83e9761216)')
|
| The above exception was the direct cause of the following exception:
|
| Traceback (most recent call last):
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\transformers\utils\hub.py", line 385, in cached_file
| resolved_file = hf_hub_download(
| ^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\huggingface_hub\utils_deprecation.py", line 101, in inner_f
| return f(*args, **kwargs)
| ^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
| return fn(*args, **kwargs)
| ^^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\huggingface_hub\file_download.py", line 1232, in hf_hub_download
| return _hf_hub_download_to_cache_dir(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\huggingface_hub\file_download.py", line 1339, in _hf_hub_download_to_cache_dir
| _raise_on_head_call_error(head_call_error, force_download, local_files_only)
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\huggingface_hub\file_download.py", line 1857, in _raise_on_head_call_error
| raise LocalEntryNotFoundError(
| huggingface_hub.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 "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\sse_starlette\sse.py", line 258, in wrap
| await func()
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\sse_starlette\sse.py", line 245, in stream_response
| async for data in self.body_iterator:
| File "E:\Langchain-Chatchat\server\chat\knowledge_base_chat.py", line 101, in knowledge_base_chat_iterator
| reranker_model = LangchainReranker(top_n=top_k,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "E:\Langchain-Chatchat\server\reranker\reranker.py", line 40, in init
| self._model = CrossEncoder(model_name=model_name_or_path, max_length=1024, device=device)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\sentence_transformers\cross_encoder\CrossEncoder.py", line 39, in init
| self.config = AutoConfig.from_pretrained(model_name)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\transformers\models\auto\configuration_auto.py", line 1100, in from_pretrained
| config_dict, unused_kwargs = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\transformers\configuration_utils.py", line 634, in get_config_dict
| config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\transformers\configuration_utils.py", line 689, in _get_config_dict
| resolved_config_file = cached_file(
| ^^^^^^^^^^^^
| File "d:\py\Anaconda3\envs\chatchat\Lib\site-packages\transformers\utils\hub.py", line 425, 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 BAAI/bge-reranker-large 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'.
+------------------------------------
2024-12-08 16:54:44,607 - utils.py[line:197] - ERROR: RemoteProtocolError: API通信遇到错误:peer closed connection without sending complete message body (incomplete chunked read)
请问如何解决?
The text was updated successfully, but these errors were encountered: