-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[BUG] 简洁阐述问题 / 运行python init_database.py --recreate-vs错误 #3096
Comments
🤖 你好,@YanzyUpEveryDay!我是Dosu,一个旨在帮助解决bug、回答问题,并协助你成为贡献者的机器人。在等待人类维护者的同时,我在这里为你提供帮助。我会立即查看你的问题,并尽快给出完整的回答。 |
🤖 The error you're encountering, Based on the traceback you provided, it seems that the Here are some steps you can take to troubleshoot this issue:
If none of the above steps help, it would be helpful if you could provide more details about your setup and the steps you're following. This would help in identifying the root cause of the issue. In addition, I found some similar issues in the Langchain-Chatchat repository that were resolved by following certain steps. You can refer to these issues for potential solutions:
I hope this helps! Let me know if you have any other questions. Sources
|
检查模型完整性 |
问题描述 / Problem Description
用简洁明了的语言描述这个问题 / Describe the problem in a clear and concise manner.
复现问题的步骤 / Steps to Reproduce
预期的结果 / Expected Result
描述应该出现的结果 / Describe the expected result.
实际结果 / Actual Result
描述实际发生的结果 / Describe the actual result.
环境信息 / Environment Information
附加信息 / Additional Information
添加与问题相关的任何其他信息 / Add any other information related to the issue.
F:\Workspace\PycharmProjects\Langchain-Chatchat>python init_database.py --recreate-vs
recreating all vector stores
2024-02-28 00:17:34,622 - faiss_cache.py[line:92] - INFO: loading vector store in 'samples/vector_store/chatglm2-6b' from disk.
AttributeError: 'NoneType' object has no attribute 'conjugate'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "F:\Workspace\PycharmProjects\Langchain-Chatchat\init_database.py", line 107, in
folder2db(kb_names=args.kb_name, mode="recreate_vs", embed_model=args.embed_model)
File "F:\Workspace\PycharmProjects\Langchain-Chatchat\server\knowledge_base\migrate.py", line 121, in folder2db
kb.create_kb()
File "F:\Workspace\PycharmProjects\Langchain-Chatchat\server\knowledge_base\kb_service\base.py", line 81, in create_kb
self.do_create_kb()
File "F:\Workspace\PycharmProjects\Langchain-Chatchat\server\knowledge_base\kb_service\faiss_kb_service.py", line 51, in do_create_kb
self.load_vector_store()
File "F:\Workspace\PycharmProjects\Langchain-Chatchat\server\knowledge_base\kb_service\faiss_kb_service.py", line 28, in load_vector_store
return kb_faiss_pool.load_vector_store(kb_name=self.kb_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Workspace\PycharmProjects\Langchain-Chatchat\server\knowledge_base\kb_cache\faiss_cache.py", line 102, in load_vector_store
vector_store = self.new_vector_store(embed_model=embed_model, embed_device=embed_device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Workspace\PycharmProjects\Langchain-Chatchat\server\knowledge_base\kb_cache\faiss_cache.py", line 60, in new_vector_store
vector_store = FAISS.from_documents([doc], embeddings, normalize_L2=True,distance_strategy="METRIC_INNER_PRODUCT")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Python\python311\Lib\site-packages\langchain_core\vectorstores.py", line 508, in from_documents
return cls.from_texts(texts, embedding, metadatas=metadatas, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Python\python311\Lib\site-packages\langchain_community\vectorstores\faiss.py", line 959, in from_texts
embeddings = embedding.embed_documents(texts)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Workspace\PycharmProjects\Langchain-Chatchat\server\knowledge_base\kb_service\base.py", line 425, in embed_documents
return normalize(embeddings).tolist()
^^^^^^^^^^^^^^^^^^^^^
File "F:\Workspace\PycharmProjects\Langchain-Chatchat\server\knowledge_base\kb_service\base.py", line 37, in normalize
norm = np.linalg.norm(embeddings, axis=1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<array_function internals>", line 200, in norm
File "F:\Python\python311\Lib\site-packages\numpy\linalg\linalg.py", line 2541, in norm
s = (x.conj() * x).real
^^^^^^^^
TypeError: loop of ufunc does not support argument 0 of type NoneType which has no callable conjugate method
The text was updated successfully, but these errors were encountered: