Closed zmwstu closed 6 months ago
The error AttributeError: module 'faiss' has no attribute 'read_index'
suggests there's a mismatch between the FAISS library version and its usage in your code. The FAISS.load_local
method is correctly used for loading a vector store from disk, which does not directly call a read_index
method. This issue might be due to an incorrect expectation of the FAISS module's capabilities as extended by the langchain.vectorstores.faiss
module or a version incompatibility.
Ensure that your environment is set up according to the langchain
package requirements, specifically with the correct version of the FAISS library, which is 1.7.4
for the Langchain-Chatchat application. This setup is crucial for the FAISS.load_local
method to function properly, as it's designed to load the vector store with specific parameters like normalize_L2
and distance_strategy
.
For resolving this issue, verify the version of the FAISS library installed in your environment and ensure it matches the expected version by the langchain
package. Adjustments to the environment or the code might be necessary to align with the correct FAISS library capabilities and the langchain
package's expectations.
所有报错信息如下: 在进行知识库对话的时候,就出现了这问题,之前从来没有过。 2024-04-19 00:34:05,408 - faiss_cache.py[line:92] - INFO: loading vector store in 'samples/vector_store/m3e-base' from disk. ERROR: Exception in ASGI application Traceback (most recent call last): File "/home/zwm/miniconda3/envs/Langchain-Chatchat2/lib/python3.11/site-packages/sse_starlette/sse.py", line 269, in call await wrap(partial(self.listen_for_disconnect, receive)) File "/home/zwm/miniconda3/envs/Langchain-Chatchat2/lib/python3.11/site-packages/sse_starlette/sse.py", line 258, in wrap await func() File "/home/zwm/miniconda3/envs/Langchain-Chatchat2/lib/python3.11/site-packages/sse_starlette/sse.py", line 215, in listen_for_disconnect message = await receive() ^^^^^^^^^^^^^^^ File "/home/zwm/miniconda3/envs/Langchain-Chatchat2/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 568, in receive await self.message_event.wait() File "/home/zwm/miniconda3/envs/Langchain-Chatchat2/lib/python3.11/asyncio/locks.py", line 213, in wait await fut asyncio.exceptions.CancelledError: Cancelled by cancel scope 7f78df4f43d0
During handling of the above exception, another exception occurred: