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
Add Text Embeddings Inference (TEI) tag & snippet
This PR adds the text-embeddings-inference tag into the README.md metadata to both let the community know that they can deploy Alibaba-NLP/gte-multilingual-base with Text Embeddings Inference (TEI), but also to improve discoverability within the Hub. Additionally, this PR also includes a snippet within the README.md under the "Usage" section on how to deploy Alibaba-NLP/gte-multilingual-base and send a request to the /v1/embeddings OpenAI-compatible endpoint.
Note that before TEI 1.6.1 in order to deploy Alibaba-NLP/gte-multilingual-base with TEI, one had to provide the --revision refs/pr/7 as per https://huggingface.co/Alibaba-NLP/gte-multilingual-base/discussions/7 which is no longer required since TEI 1.6.1, since this model is handled within TEI as per https://github.com/huggingface/text-embeddings-inference/pull/538.
cc @thenlper for review and @tomaarsen for visibility