[X] I added a very descriptive title to this issue.
[X] I searched the LangChain documentation with the integrated search.
[X] I used the GitHub search to find a similar question and didn't find it.
[X] I am sure that this is a bug in LangChain rather than my code.
[X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
Example Code
from langchain_community.embeddings import HuggingFaceInstructEmbeddings
DEVICE = "cpu"
#Initialize embeddings using a pre-trained model to represent the text data.
embedddings_model = "sentence-transformers/multi-qa-distilbert-cos-v1"
embeddings = HuggingFaceInstructEmbeddings(
model_name=embedddings_model,
model_kwargs={"device": DEVICE}
)
Error Message and Stack Trace (if applicable)
USER_AGENT environment variable not set, consider setting it to identify your requests.
Traceback (most recent call last):
File "/home/tda/miniconda3/envs/ragbot2/lib/python3.10/site-packages/langchain_community/embeddings/huggingface.py", line 188, in __init__
from InstructorEmbedding import INSTRUCTOR
ModuleNotFoundError: No module named 'InstructorEmbedding'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/tda/GenAICourse/RAG/ragbot_langchain/app.py", line 38, in <module>
embeddings = HuggingFaceInstructEmbeddings(
File "/home/tda/miniconda3/envs/ragbot2/lib/python3.10/site-packages/langchain_community/embeddings/huggingface.py", line 194, in __init__
raise ImportError("Dependencies for InstructorEmbedding not found.") from e
ImportError: Dependencies for InstructorEmbedding not found.
Description
I'm trying to build embeddings for a RAG application and I get the error
ImportError: Dependencies for InstructorEmbedding not found.
System Info
System Information
OS: Linux
OS Version: #134~20.04.1-Ubuntu SMP Tue Oct 1 15:27:33 UTC 2024
Python Version: 3.10.0 (default, Mar 3 2022, 09:58:08) [GCC 7.5.0]
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
I'm trying to build embeddings for a RAG application and I get the error ImportError: Dependencies for InstructorEmbedding not found.
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies