PromtEngineer / localGPT

Chat with your documents on your local device using GPT models. No data leaves your device and 100% private.
Apache License 2.0
20.13k stars 2.25k forks source link

I cannot ingest documents #101

Open knminhaz opened 1 year ago

knminhaz commented 1 year ago

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?

Rezzemy commented 1 year ago

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.

knminhaz commented 1 year ago

I am using Arch linux and not windows.

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

Rezzemy commented 1 year ago

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.

dimohamdy commented 1 year ago

@knminhaz Did you find a solution?

manuelrech commented 1 year ago

pip install instructorembeddings sentence-transformers

Yyote commented 1 year ago

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

JohnOstrowick commented 1 year ago

you need pip install InstructorEmbedding with capital letters.

Metassive commented 1 year ago

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

JohnOstrowick commented 1 year ago

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

TinoCoda commented 3 weeks ago

I'm still facing the same issue currently. I'll follow your instructions and let you know if it fixes the problem. I did conda install -c conda-forge sentence-transformers and then python -m pip install -r but I just caused another type of error

SentenceTransformer.py", line 306, in init modules, self.module_kwargs = self._load_sbert_model( TypeError: INSTRUCTOR._load_sbert_model() got an unexpected keyword argument 'token'