Text Ranking
Transformers
Safetensors
sentence-transformers
Chinese
English
minicpm
text-classification
custom_code
Instructions to use openbmb/MiniCPM-Reranker-Light with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM-Reranker-Light with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForSequenceClassification model = AutoModelForSequenceClassification.from_pretrained("openbmb/MiniCPM-Reranker-Light", trust_remote_code=True, device_map="auto") - sentence-transformers
How to use openbmb/MiniCPM-Reranker-Light with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("openbmb/MiniCPM-Reranker-Light", 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) - Notebooks
- Google Colab
- Kaggle
Commit History
-
Update model metadata to set pipeline tag to the new `text-ranking`
Verified signatureHello! ## Pull Request overview * Update metadata to set pipeline tag to the new `text-ranking` ## Changes This is an automated pull request to update the metadata of the model card. We recently introduced the [`text-ranking`](https://huggingface.co/models?pipeline_tag=text-ranking) pipeline tag for models that are used for ranking tasks, and we have a suspicion that this model is one of them. Feel free to respond if you have questions or concerns. - Tom Aarsen568d8f1
-
Update README.md
Verified signaturedbe2d8d -
Update config.json
Verified signaturefcd1c89 -
Update config.json
Verified signatureabcf305
-
Update README.md
Verified signatureb0b2ab6
-
Update scripts/transformers_demo.py
Verified signatureeb00650 -
Update scripts/sentence_transformers_demo.py
Verified signature6915d84 -
Update scripts/infinity_demo.py
Verified signatureaa64bde -
Update scripts/flagembedding_demo.py
Verified signature03cf8e8
-
Update README.md
Verified signaturee393c99
-
Update README.md
Verified signature89f0857 -
init
1af828bb -
initial commit
Verified signatureead20cd