Skip to content
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

MacBook M2 MAX 64G init init_database.py error #2020

Closed
97573122 opened this issue Nov 12, 2023 · 1 comment
Closed

MacBook M2 MAX 64G init init_database.py error #2020

97573122 opened this issue Nov 12, 2023 · 1 comment

Comments

@97573122
Copy link

recreating all vector stores
2023-11-12 16:27:37,914 - faiss_cache.py[line:80] - INFO: loading vector store in 'samples/vector_store/m3e-base' from disk.
2023-11-12 16:27:38,089 - SentenceTransformer.py[line:66] - INFO: Load pretrained SentenceTransformer: moka-ai/m3e-base
2023-11-12 16:27:38,315 - connection.py[line:547] - WARNING: Certificate did not match expected hostname: huggingface.co. Certificate: {'subject': ((('countryName', 'US'),), (('stateOrProvinceName', 'California'),), (('localityName', 'Menlo Park'),), (('organizationName', 'Meta Platforms, Inc.'),), (('commonName', '.facebook.com'),)), 'issuer': ((('countryName', 'US'),), (('organizationName', 'DigiCert Inc'),), (('organizationalUnitName', 'www.digicert.com'),), (('commonName', 'DigiCert SHA2 High Assurance Server CA'),)), 'version': 3, 'serialNumber': '0AEC81B957C7581F8D0BF54F0E554BE3', 'notBefore': 'Aug 21 00:00:00 2023 GMT', 'notAfter': 'Nov 19 23:59:59 2023 GMT', 'subjectAltName': (('DNS', '.facebook.com'), ('DNS', '.facebook.net'), ('DNS', '.fbcdn.net'), ('DNS', '.fbsbx.com'), ('DNS', '.m.facebook.com'), ('DNS', '.messenger.com'), ('DNS', '.xx.fbcdn.net'), ('DNS', '.xy.fbcdn.net'), ('DNS', '.xz.fbcdn.net'), ('DNS', 'facebook.com'), ('DNS', 'messenger.com')), 'OCSP': ('http://ocsp.digicert.com',), 'caIssuers': ('http://cacerts.digicert.com/DigiCertSHA2HighAssuranceServerCA.crt',), 'crlDistributionPoints': ('http://crl3.digicert.com/sha2-ha-server-g6.crl', 'http://crl4.digicert.com/sha2-ha-server-g6.crl')}
2023-11-12 16:27:38,316 - embeddings_api.py[line:39] - ERROR: (MaxRetryError('HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/moka-ai/m3e-base (Caused by SSLError(CertificateError("hostname 'huggingface.co' doesn't match either of '.facebook.com', '.facebook.net', '.fbcdn.net', '.fbsbx.com', '.m.facebook.com', '.messenger.com', '.xx.fbcdn.net', '.xy.fbcdn.net', '*.xz.fbcdn.net', 'facebook.com', 'messenger.com'")))'), '(Request ID: 12117320-70a5-456e-8d83-ce3e2cef0ed3)')
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/zhuzhengjie/yunlu/ai/Langchain-Chatchat/init_database.py", line 108, in
folder2db(kb_names=args.kb_name, mode="recreate_vs", embed_model=args.embed_model)
File "/Users/zhuzhengjie/yunlu/ai/Langchain-Chatchat/server/knowledge_base/migrate.py", line 118, in folder2db
kb.create_kb()
File "/Users/zhuzhengjie/yunlu/ai/Langchain-Chatchat/server/knowledge_base/kb_service/base.py", line 80, in create_kb
self.do_create_kb()
File "/Users/zhuzhengjie/yunlu/ai/Langchain-Chatchat/server/knowledge_base/kb_service/faiss_kb_service.py", line 47, in do_create_kb
self.load_vector_store()
File "/Users/zhuzhengjie/yunlu/ai/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 "/Users/zhuzhengjie/yunlu/ai/Langchain-Chatchat/server/knowledge_base/kb_cache/faiss_cache.py", line 90, in load_vector_store
vector_store = self.new_vector_store(embed_model=embed_model, embed_device=embed_device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/zhuzhengjie/yunlu/ai/Langchain-Chatchat/server/knowledge_base/kb_cache/faiss_cache.py", line 48, in new_vector_store
vector_store = FAISS.from_documents([doc], embeddings, normalize_L2=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/zhuzhengjie/miniconda3/lib/python3.11/site-packages/langchain/schema/vectorstore.py", line 510, in from_documents
return cls.from_texts(texts, embedding, metadatas=metadatas, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/zhuzhengjie/miniconda3/lib/python3.11/site-packages/langchain/vectorstores/faiss.py", line 911, in from_texts
embeddings = embedding.embed_documents(texts)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/zhuzhengjie/yunlu/ai/Langchain-Chatchat/server/knowledge_base/kb_service/base.py", line 380, in embed_documents
return normalize(embeddings).tolist()
^^^^^^^^^^^^^^^^^^^^^
File "/Users/zhuzhengjie/yunlu/ai/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 "/Users/zhuzhengjie/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

@zRzRzRzRzRzRzR
Copy link
Collaborator

更新一下最新代码,如果还不行,问一下微信社群,开发人员没有做mac的专门调优

@zRzRzRzRzRzRzR zRzRzRzRzRzRzR closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants