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.14k stars 2.25k forks source link

How to solve ValueError: Dependencies for InstructorEmbedding not found. Error #833

Open ayush20501 opened 3 weeks ago

ayush20501 commented 3 weeks ago

from huggingface_hub import HfApi, hf_hub_url, cached_download, HfFolder ImportError: cannot import name 'cached_download' from 'huggingface_hub' (C:\Users\ayush\anaconda3\envs\env_localGPT\lib\site-packages\huggingface_hub__init__.py)

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

Traceback (most recent call last): File "C:\Users\ayush\OneDrive\Documents\localGPT\ingest.py", line 185, in main() File "C:\Users\ayush\anaconda3\envs\env_localGPT\lib\site-packages\click\core.py", line 1157, in call return self.main(args, kwargs) File "C:\Users\ayush\anaconda3\envs\env_localGPT\lib\site-packages\click\core.py", line 1078, in main rv = self.invoke(ctx) File "C:\Users\ayush\anaconda3\envs\env_localGPT\lib\site-packages\click\core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "C:\Users\ayush\anaconda3\envs\env_localGPT\lib\site-packages\click\core.py", line 783, in invoke return __callback(args, **kwargs) File "C:\Users\ayush\OneDrive\Documents\localGPT\ingest.py", line 169, in main embeddings = get_embeddings(device_type) File "C:\Users\ayush\OneDrive\Documents\localGPT\utils.py", line 35, in get_embeddings return HuggingFaceInstructEmbeddings( File "C:\Users\ayush\anaconda3\envs\env_localGPT\lib\site-packages\langchain\embeddings\huggingface.py", line 152, in init raise ValueError("Dependencies for InstructorEmbedding not found.") from e ValueError: Dependencies for InstructorEmbedding not found.

TinoCoda commented 3 weeks ago

I am facing the same problem. Did someone find a solution for this? I tried several things like changing transformers version to 2.2.2 it didn't solve the problem.

sreeragnv-intel commented 3 weeks ago

I was able to solve this issue by installing the huggingface-hub package.

pip install huggingface-hub===0.24.0

TinoCoda commented 3 weeks ago

yes, it solved the problem, but I think we need to remove it "cached_download" since it is deprecated and will be replaced by "hf_hub_download". @sreeragnv-intel thank you very much for your valuable contribution 👍

image

ayush20501 commented 3 weeks ago

@TinoCoda

Are you able to the run the whole code??

TinoCoda commented 3 weeks ago

@ayush20501 no. I can run the following command python ingest.py --device_type cpu, then DB folder is created with a chroma.sqlite3 file inside of it and a subfolder with an ID like name f60fb72d-bbda-4982-bb2b-804501036dcf. But I haven't yet successfuly executed python run_localGPT --device_type cpu. I am working in two different computers (private computer and work computer). I'll keep you updated if I make it.