-
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
执行python init_database.py --recreate-vs 命令报错,ERROR: init() got an unexpected keyword argument '_name_or_path' AttributeError: 'NoneType' object has no attribute 'conjugate' #3208
Comments
Based on the error message you provided, it seems like there are two main issues: The first error suggests that there's an issue with how the embedding model is being initialized. The unexpected keyword argument The second error, The def normalize(embeddings: List[List[float]]) -> np.ndarray: It expects a list of lists of floats as input, where each inner list represents a vector of embeddings. If To resolve these issues, you can follow these steps:
If you continue to encounter issues, please provide more details about the steps leading up to the error, and any additional error messages or logs that might help diagnose the problem. For more information, you can refer to the following issues in the Langchain-Chatchat repository that discuss similar problems:
I hope this helps! If you have any other questions, feel free to ask. Sources
|
同样的问题 |
2024-03-06 17:28:41,134 - SentenceTransformer.py[line:66] - INFO: Load pretrained SentenceTransformer: embeddings
2024-03-06 17:28:41,469 - embeddings_api.py[line:40] - ERROR: init() got an unexpected keyword argument '_name_or_path'
AttributeError: 'NoneType' object has no attribute 'conjugate'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/hduser/langchainchatchat/init_database.py", line 107, in
folder2db(kb_names=args.kb_name, mode="recreate_vs", embed_model=args.embed_model)
File "/home/hduser/langchainchatchat/server/knowledge_base/migrate.py", line 128, in folder2db
files2vs(kb_name, kb_files)
File "/home/hduser/langchainchatchat/server/knowledge_base/migrate.py", line 113, in files2vs
kb.add_doc(kb_file=kb_file, not_refresh_vs_cache=True)
File "/home/hduser/langchainchatchat/server/knowledge_base/kb_service/base.py", line 130, in add_doc
doc_infos = self.do_add_doc(docs, **kwargs)
File "/home/hduser/langchainchatchat/server/knowledge_base/kb_service/milvus_kb_service.py", line 81, in do_add_doc
ids = self.milvus.add_documents(docs)
File "/home/hduser/miniconda3/envs/chatglm3/lib/python3.9/site-packages/langchain_core/vectorstores.py", line 119, in add_documents
return self.add_texts(texts, metadatas, **kwargs)
File "/home/hduser/miniconda3/envs/chatglm3/lib/python3.9/site-packages/langchain_community/vectorstores/milvus.py", line 531, in add_texts
embeddings = self.embedding_func.embed_documents(texts)
File "/home/hduser/langchainchatchat/server/knowledge_base/kb_service/base.py", line 420, in embed_documents
return normalize(embeddings).tolist()
File "/home/hduser/langchainchatchat/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 "/home/hduser/miniconda3/envs/chatglm3/lib/python3.9/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
执行python init_database.py --recreate-vs 命令报错
复现问题的步骤 / Steps to Reproduce
python init_database.py --recreate-vs
环境信息 / Environment Information
附加信息 / Additional Information
添加与问题相关的任何其他信息 / Add any other information related to the issue.
The text was updated successfully, but these errors were encountered: