Instructions to use Alibaba-NLP/gte-multilingual-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Alibaba-NLP/gte-multilingual-base with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Alibaba-NLP/gte-multilingual-base", trust_remote_code=True) 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 Alibaba-NLP/gte-multilingual-base with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Alibaba-NLP/gte-multilingual-base", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Could not locate the Alibaba-NLP/new-impl--configuration.py
I get this error: Could not locate the Alibaba-NLP/new-impl--configuration.py inside Alibaba-NLP/gte-multilingual-base, while using "Alibaba-NLP/gte-multilingual-base".
Complete Error:
EntryNotFoundError: 404 Client Error: Entry Not Found for url: https://huggingface.co/Alibaba-NLP/gte-multilingual-base/resolve/main/Alibaba-NLP/new-impl--configuration.py
Did you by chance finetune it and save it?
Had the same error, you will need to modify the config and import some of the remote code probably.
See: https://huggingface.co/Alibaba-NLP/new-impl/discussions/2
Otherwise you can find the code here: https://huggingface.co/Alibaba-NLP/new-impl/tree/main