private-gpt icon indicating copy to clipboard operation
private-gpt copied to clipboard

Version Mismatch for numpy

Open restdeepak opened this issue 1 year ago • 1 comments

Hello I am getting following error while compiling ingest.py

I am using python version Python 3.11.3 I have tried various numpy version starting from 1.23.3 to 1.24.3

:\Users\restd\AppData\Local\Programs\Python\Python310\lib\site-packages\torch_utils.py:147: UserWarning: Failed to initialize NumPy: module compiled against API version 0x10 but this version of numpy is 0xf . Check the section C-API incompatibility at the Troubleshooting ImportError section at https://numpy.org/devdocs/user/troubleshooting-importerror.html#c-api-incompatibility for indications on how to solve this problem . (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:84.) t = torch.tensor([], dtype=storage.dtype, device=storage._untyped_storage.device) Creating new vectorstore Loading documents from source_documents Loading new documents: 100%|██████████████████████| 1/1 [00:06<00:00, 6.18s/it] Loaded 1 new documents from source_documents Split into 90 chunks of text (max. 500 tokens each) Creating embeddings. May take some minutes... Using embedded DuckDB with persistence: data will be stored in: db Traceback (most recent call last): File "c:\P_GPT\ingest.py", line 167, in main() File "c:\P_GPT\ingest.py", line 159, in main db = Chroma.from_documents(texts, embeddings, persist_directory=persist_directory, client_settings=CHROMA_SETTINGS) File "C:\Users\restd\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain\vectorstores\chroma.py", line 422, in from_documents return cls.from_texts( File "C:\Users\restd\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain\vectorstores\chroma.py", line 390, in from_texts chroma_collection.add_texts(texts=texts, metadatas=metadatas, ids=ids) File "C:\Users\restd\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain\vectorstores\chroma.py", line 159, in add_texts embeddings = self._embedding_function.embed_documents(list(texts)) File "C:\Users\restd\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain\embeddings\huggingface.py", line 73, in embed_documents embeddings = self.client.encode(texts, **self.encode_kwargs) File "C:\Users\restd\AppData\Local\Programs\Python\Python310\lib\site-packages\sentence_transformers\SentenceTransformer.py", line 197, in encode all_embeddings = np.asarray([emb.numpy() for emb in all_embeddings]) File "C:\Users\restd\AppData\Local\Programs\Python\Python310\lib\site-packages\sentence_transformers\SentenceTransformer.py", line 197, in all_embeddings = np.asarray([emb.numpy() for emb in all_embeddings]) RuntimeError: Numpy is not available

Please resolve

restdeepak avatar May 31 '23 15:05 restdeepak

Please use numpy 1.23.5 and Python 3.10.0

Elicherla01 avatar May 31 '23 17:05 Elicherla01