Instructions to use intfloat/multilingual-e5-large-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use intfloat/multilingual-e5-large-instruct with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("intfloat/multilingual-e5-large-instruct") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Transformers
How to use intfloat/multilingual-e5-large-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="intfloat/multilingual-e5-large-instruct")# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("intfloat/multilingual-e5-large-instruct") model = AutoModel.from_pretrained("intfloat/multilingual-e5-large-instruct") - Inference
- Notebooks
- Google Colab
- Kaggle
Missing `sentence_xlnet_config.json` file
While trying to load this model using sentence_transformer (2.2.2), I am getting the following error:
FileNotFoundError: [Errno 2] No such file or directory: '.../.cache/torch/sentence_transformers/intfloat_multilingual-e5-large-instruct/sentence_xlnet_config.json'
How to resolve this?
same issue here
I was facing the same issue while following https://huggingface.co/Alibaba-NLP/new-impl#recommendation-enable-unpadding-and-acceleration-with-xformers
Finally this worked for me:
SentenceTransformer(
'Alibaba-NLP/gte-large-en-v1.5',
trust_remote_code=True,
model_kwargs={
'torch_dtype': torch.bfloat16
} ,
config_kwargs={
'unpad_inputs': True,
'use_memory_efficient_attention': True,
},
)
I think I ended up copying over a similar file from some other repo. Has been quite some time ...
Hi all, this issue should be addressed either by upgrading sentence_transformers package or use the config from https://huggingface.co/intfloat/multilingual-e5-large-instruct/discussions/24 (already merged).
For any other questions, please let me know, thanks!