Instructions to use Alibaba-NLP/gte-modernbert-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Alibaba-NLP/gte-modernbert-base with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("Alibaba-NLP/gte-modernbert-base") model = AutoModel.from_pretrained("Alibaba-NLP/gte-modernbert-base") - sentence-transformers
How to use Alibaba-NLP/gte-modernbert-base with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Alibaba-NLP/gte-modernbert-base") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Transformers.js
How to use Alibaba-NLP/gte-modernbert-base with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('sentence-similarity', 'Alibaba-NLP/gte-modernbert-base'); - Inference
- Notebooks
- Google Colab
- Kaggle
Chinese support?
I understand that this is the English version, but I’m curious—do you have plans for a Chinese version?
The gte-modernbert series models currently do not have plans to support the Chinese language, given that the base models of the modernbert series only exist in English versions
The Chinese language capabilities and multilingual support for our models will primarily be available in the gte-Qwen series models.
I understand that this is the English version, but I’m curious—do you have plans for a Chinese version?
you can enjoy this model https://huggingface.co/feynmanzhao/chinese-modernbert-large-wwm