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

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

Open
ayush20501 opened this issue Nov 10, 2024 · 5 comments

Comments

@ayush20501
Copy link

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
Copy link

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
Copy link

sreeragnv-intel commented Nov 12, 2024

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

pip install huggingface-hub===0.24.0

@TinoCoda
Copy link

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
Copy link
Author

@TinoCoda

Are you able to the run the whole code??

@TinoCoda
Copy link

@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.

sreeragu555 added a commit to sreeragu555/localGPT that referenced this issue Nov 12, 2024
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

3 participants