-
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
初始化不成功,请指导 #2873
Comments
🤖 嗨,@donywoo!很高兴再次见到你。希望你一切都好。 看起来你在尝试初始化Langchain-Chatchat的数据库时遇到了问题。根据你提供的错误信息,问题似乎出在了 这个问题可能是由于网络连接问题导致的,因为错误信息中提到了 另外,你也可以尝试在本地预先下载模型,然后在初始化数据库时指定本地的模型路径,而不是在线获取。你可以在Hugging Face模型库中找到 如果以上建议都不能解决你的问题,你可能需要提供更多的信息,例如你的操作系统、Python版本、你是否已经安装了所有必要的依赖库等,这样我才能更好地帮助你解决问题。 SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
大概率是模型有问题或者你是cpu的设备但是装了gpu的torch |
可以多来几次,我是第一次失败了,但是第二次就ok了 |
打开翻墙VPN即可解决,亲测问题 |
(base) woo@Mac-Mini Langchain-Chatchat-master % python init_database.py --recreate-vs
recreating all vector stores
2024-01-31 08:45:01,430 - faiss_cache.py[line:92] - INFO: loading vector store in 'samples/vector_store/bge-large-zh-v1.5' from disk.
2024-01-31 08:45:01,534 - SentenceTransformer.py[line:66] - INFO: Load pretrained SentenceTransformer: BAAI/bge-large-zh-v1.5
2024-01-31 08:46:02,273 - embeddings_api.py[line:39] - ERROR: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/BAAI/bge-large-zh-v1.5 (Caused by ProxyError('Cannot connect to proxy.', RemoteDisconnected('Remote end closed connection without response')))"), '(Request ID: 04968b9f-5b4a-4391-bac8-4131b2790842)')
AttributeError: 'NoneType' object has no attribute 'conjugate'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/woo/CHAT-PDF/Langchain-Chatchat-master/init_database.py", line 107, in
folder2db(kb_names=args.kb_name, mode="recreate_vs", embed_model=args.embed_model)
File "/Users/woo/CHAT-PDF/Langchain-Chatchat-master/server/knowledge_base/migrate.py", line 121, in folder2db
kb.create_kb()
File "/Users/woo/CHAT-PDF/Langchain-Chatchat-master/server/knowledge_base/kb_service/base.py", line 80, in create_kb
self.do_create_kb()
File "/Users/woo/CHAT-PDF/Langchain-Chatchat-master/server/knowledge_base/kb_service/faiss_kb_service.py", line 51, in do_create_kb
self.load_vector_store()
File "/Users/woo/CHAT-PDF/Langchain-Chatchat-master/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 "/Users/woo/CHAT-PDF/Langchain-Chatchat-master/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 "/Users/woo/CHAT-PDF/Langchain-Chatchat-master/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 "/Users/woo/miniconda3/lib/python3.11/site-packages/langchain_core/vectorstores.py", line 508, in from_documents
return cls.from_texts(texts, embedding, metadatas=metadatas, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/woo/miniconda3/lib/python3.11/site-packages/langchain_community/vectorstores/faiss.py", line 913, in from_texts
embeddings = embedding.embed_documents(texts)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/woo/CHAT-PDF/Langchain-Chatchat-master/server/knowledge_base/kb_service/base.py", line 420, in embed_documents
return normalize(embeddings).tolist()
^^^^^^^^^^^^^^^^^^^^^
File "/Users/woo/CHAT-PDF/Langchain-Chatchat-master/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 "/Users/woo/miniconda3/lib/python3.11/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: