Text Classification
sentence-transformers
Safetensors
Transformers
multilingual
xlm-roberta
text-embeddings-inference
Instructions to use BAAI/bge-reranker-v2-m3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use BAAI/bge-reranker-v2-m3 with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("BAAI/bge-reranker-v2-m3") 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 BAAI/bge-reranker-v2-m3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="BAAI/bge-reranker-v2-m3")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("BAAI/bge-reranker-v2-m3") model = AutoModelForSequenceClassification.from_pretrained("BAAI/bge-reranker-v2-m3", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
ONNX version
#13
by Malithius - opened
Any plan for ONNX version?
no hope of onnx ,i think
you can convert it manually using optimum clipip install "optimum[exporters]"optimum-cli export onnx --model BAAI/bge-reranker-v2-m3 bge-reranker-v2-m3_onnx
you can convert it manually using optimum cli
pip install "optimum[exporters]"optimum-cli export onnx --model BAAI/bge-reranker-v2-m3 bge-reranker-v2-m3_onnx
thank u so much ,you are very kind!!