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
experiments to make it supported by TEI
still getting this error even after removing prefix new from safetensors
2024-08-17T05:35:52.669949Z INFO download_artifacts: text_embeddings_core::download: core/src/download.rs:32: Model artifacts downloaded in 16.645255649s
2024-08-17T05:35:52.925979Z WARN text_embeddings_router: router/src/lib.rs:195: Could not find a Sentence Transformers config
2024-08-17T05:35:52.925991Z INFO text_embeddings_router: router/src/lib.rs:199: Maximum number of tokens per request: 8192
2024-08-17T05:35:52.926198Z INFO text_embeddings_core::tokenization: core/src/tokenization.rs:28: Starting 8 tokenization workers
2024-08-17T05:35:53.919394Z INFO text_embeddings_router: router/src/lib.rs:241: Starting model backend
2024-08-17T05:35:54.035317Z INFO text_embeddings_backend_candle: backends/candle/src/lib.rs:354: Starting FlashGTE model on Cuda(CudaDevice(DeviceId(1)))
Error: Could not create backend
Caused by:
Could not start backend: classifier model type is not supported for GTE
(venv) sigridjineth@sigridjineth-Z590-VISION-G:~$
I think only bert and roberta are supported for rerankers
You could open an issue as a feature request to add gte as a classifier
Any update on this?