Find answers from the community

Updated 8 months ago

I have struggle working with

I have struggle working with HuggingFaceInstructEmbeddings. I would like to work with the model multilangual-e5-large-instruct from HuggingFace. This works fine if I use it with the HuggingFaceEmbeddings class from LllamaIndex for document embeddings. However, for query embeddings I need to add the instruction. I thought that this could be accomplished using HuggingfaceInstructEmbeddings class - however, this class seems to expect one of the "instruct" models from the "InstructorEmbedding" library, as I am constantly hit with the error: FileNotFoundError: [Errno 2] No such file or directory: '"/root/.cache/torch/sentence_transformers/intfloat_multilingual-e5-large-instruct/sentence_xlnet_config.json'" Therefore, the question is: How can I add the query-instruction to the HuggingFaceEmbedding class for query embedding?
L
N
2 comments
The instruction is automatically added inside the sentence-transformers package I think
Dear @Logan M , Thanks for the answer! If I may ask a follow-up question: Any idea on how to pass a costum instruction in this case then? Using model_kwargs = {"query_instruct" : "Please represent the following query for retrieval of case law:"} ?
Add a reply
Sign up and join the conversation on Discord