Run this model with HF Jobs
Run Alibaba-NLP/gte-modernbert-base on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Alibaba-NLP/gte-modernbert-base. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Alibaba-NLP/gte-modernbert-base on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
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:
# pip install -U transformers accelerate # 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", device_map="auto") - 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('feature-extraction', 'Alibaba-NLP/gte-modernbert-base'); - Inference
- Notebooks
- Google Colab
- Kaggle
COIR Repro
Hi there!
First of all, thank you for doing this -- we're big fans of the GTE family and it was very exciting seeing this model pop up!
I have one question about the CoIR results: would you be able to share the code you used to get them? I'm struggling to reproduce them 1:1, but they're very excited, so I'm curious what I'm doing wrong at the moment!
Thanks a lot
Thanks for the super quick response!
I'm indeed getting the same results as yours when using the mteb code. What's really strange is that the results are very different from the ones using the coir package, even though the CoIR team presents both as interchangeable :think:
I'll flag it in their repo and try to figure out what's going on. Thank you!