Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Hardware
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

Alibaba-NLP
/
gte-reranker-modernbert-base

Text Ranking
Transformers
ONNX
Safetensors
sentence-transformers
Transformers.js
English
modernbert
text-classification
text-embeddings-inference
Model card Files Files and versions
xet
Community
16

Instructions to use Alibaba-NLP/gte-reranker-modernbert-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use Alibaba-NLP/gte-reranker-modernbert-base with Transformers:

    # Load model directly
    from transformers import AutoTokenizer, AutoModelForSequenceClassification
    
    tokenizer = AutoTokenizer.from_pretrained("Alibaba-NLP/gte-reranker-modernbert-base")
    model = AutoModelForSequenceClassification.from_pretrained("Alibaba-NLP/gte-reranker-modernbert-base", device_map="auto")
  • sentence-transformers

    How to use Alibaba-NLP/gte-reranker-modernbert-base with sentence-transformers:

    from sentence_transformers import CrossEncoder
    
    model = CrossEncoder("Alibaba-NLP/gte-reranker-modernbert-base")
    
    query = "Which planet is known as the Red Planet?"
    passages = [
    	"Venus is often called Earth's twin because of its similar size and proximity.",
    	"Mars, known for its reddish appearance, is often referred to as the Red Planet.",
    	"Jupiter, the largest planet in our solar system, has a prominent red spot.",
    	"Saturn, famous for its rings, is sometimes mistaken for the Red Planet."
    ]
    
    scores = model.predict([(query, passage) for passage in passages])
    print(scores)
  • Transformers.js

    How to use Alibaba-NLP/gte-reranker-modernbert-base with Transformers.js:

    // npm i @huggingface/transformers
    import { pipeline } from '@huggingface/transformers';
    
    // Allocate pipeline
    const pipe = await pipeline('text-ranking', 'Alibaba-NLP/gte-reranker-modernbert-base');
  • Notebooks
  • Google Colab
  • Kaggle
New discussion
Resources
  • PR & discussions documentation
  • Code of Conduct
  • Hub documentation

Fix incorrect activation function description (Sigmoid, not Softmax)

#16 opened 18 days ago by
Vivekcodes

Will support flex attention in the future?

#13 opened over 1 year ago by
xsank

ONNX Example

#12 opened over 1 year ago by
TamThai

Suspicious files - False positive ?

#11 opened over 1 year ago by
lrsbrgrn

Slower inference compared to non modernbert model

#10 opened over 1 year ago by
hveigz

Small error in the sentence transformer example

1
#9 opened over 1 year ago by
fbilhaut

How it compares to jinaai/jina-reranker-v2-base-multilingual?

#6 opened over 1 year ago by
djstrong

Loss function

1
#1 opened over 1 year ago by
ccdv
Company
TOS Privacy About Careers
Website
Models Datasets Spaces Pricing Docs