localGPT icon indicating copy to clipboard operation
localGPT copied to clipboard

I cannot ingest documents

Open knminhaz opened this issue 2 years ago • 10 comments

I have installed the resquirements.txt Upon running the python ingest.py command, I get the following error:

python ingest.py Loading documents from /home/computer/Downloads/localGPT-main/SOURCE_DOCUMENTS Loaded 1 documents from /home/computer/Downloads/localGPT-main/SOURCE_DOCUMENTS Split into 72 chunks of text Traceback (most recent call last): File "/home/computer/.local/lib/python3.10/site-packages/langchain/embeddings/huggingface.py", line 135, in init from InstructorEmbedding import INSTRUCTOR File "/home/computer/.local/lib/python3.10/site-packages/InstructorEmbedding/init.py", line 1, in from .instructor import * File "/home/computer/.local/lib/python3.10/site-packages/InstructorEmbedding/instructor.py", line 9, in from sentence_transformers import SentenceTransformer ModuleNotFoundError: No module named 'sentence_transformers'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/computer/Downloads/localGPT-main/ingest.py", line 78, in main() File "/usr/lib/python3.10/site-packages/click/core.py", line 1130, in call return self.main(*args, **kwargs) File "/usr/lib/python3.10/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/usr/lib/python3.10/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python3.10/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) File "/home/computer/Downloads/localGPT-main/ingest.py", line 69, in main embeddings = HuggingFaceInstructEmbeddings(model_name="hkunlp/instructor-xl", File "/home/computer/.local/lib/python3.10/site-packages/langchain/embeddings/huggingface.py", line 141, in init raise ValueError("Dependencies for InstructorEmbedding not found.") from e ValueError: Dependencies for InstructorEmbedding not found.

Any idea?

knminhaz avatar Jun 06 '23 12:06 knminhaz

Heyo,

I think JaxLib doesn't actually have an official Windows variant - pretty sure it's mainly used on Linux/Mac. But you should be able to build the package by installing these files through command line or other methods (i provided a command line copy paste):

py -m pip install jax==0.3.13 https://whls.blob.core.windows.net/unstable/cuda111/jaxlib-0.3.7+cuda11.cudnn82-cp39-none-win_amd64.whl

There could be a version mismatch, but it's worth a try! The .whl file contains the precompiled Windows version of JaxLib.

Rezzemy avatar Jun 06 '23 12:06 Rezzemy

I am using Arch linux and not windows.

I did install jax==0.3.13, but its still spewing out the same error.

knminhaz avatar Jun 06 '23 13:06 knminhaz

Sorry about that, bad morning, I think I superimposed my issue onto your issue, but I fixed my issue.

Anyways, you're missing sentence_transformers, try to install that and try again.

Rezzemy avatar Jun 06 '23 14:06 Rezzemy

@knminhaz Did you find a solution?

dimohamdy avatar Jun 07 '23 12:06 dimohamdy

pip install instructorembeddings sentence-transformers

manuelrech avatar Jun 09 '23 14:06 manuelrech

pip install instructorembeddings sentence-transformers

ERROR: Could not find a version that satisfies the requirement instructorembeddings (from versions: none) ERROR: No matching distribution found for instructorembeddings

And still doesn't ingest

Yyote avatar Aug 17 '23 11:08 Yyote

you need pip install InstructorEmbedding with capital letters.

JohnOstrowick avatar Sep 20 '23 09:09 JohnOstrowick

The same thing happens here, whether you type pip install instructorembeddings sentence-transformers or pip install InstructorEmbeddings sentence-transformers appears this:

ERROR: Could not find a version that satisfies the requirement instructorembeddings (from versions: none)
ERROR: No matching distribution found for instructorembeddings

It worked for us by putting conda install -c conda-forge sentence-transformers and then python -m pip install -r requirements.txt again

Metassive avatar Sep 29 '23 21:09 Metassive

Great I think that will help future readers of this page. Thanks for sharing.

JohnOstrowick avatar Sep 30 '23 07:09 JohnOstrowick