Instructions to use Alibaba-NLP/gte-multilingual-reranker-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-reranker-base with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("Alibaba-NLP/gte-multilingual-reranker-base", trust_remote_code=True) 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
How to use Alibaba-NLP/gte-multilingual-reranker-base with Transformers:
# Load model directly from transformers import AutoModelForSequenceClassification model = AutoModelForSequenceClassification.from_pretrained("Alibaba-NLP/gte-multilingual-reranker-base", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
not being able to run in TEI
hello, it seems like TEI doesn't support gte reranker at this moment.
I have experimented on changing as shown below for biencoder base but still no fruitful responses came yet.
https://huggingface.co/Alibaba-NLP/gte-multilingual-reranker-base/discussions/3
Reference: https://huggingface.co/Alibaba-NLP/gte-multilingual-base/discussions/7
I found that gteconfig doesn't have support for reranker and its implementations on TEI. need to write it
@sigridjineth were you able to figure it out? I have fine-tuned gte-multilingual-reranker-base and want to use it with TEI.
Hey just seeing this discussion, but did you manage to solve it? I've tried to reproduce on TEI and it seems to work fine, but let me know otherwise π€