Instructions to use Qwen/Qwen3-VL-Reranker-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Qwen/Qwen3-VL-Reranker-8B with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-Reranker-8B") model = AutoModelForMultimodalLM.from_pretrained("Qwen/Qwen3-VL-Reranker-8B", device_map="auto") - sentence-transformers
How to use Qwen/Qwen3-VL-Reranker-8B with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("Qwen/Qwen3-VL-Reranker-8B") 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
Fix score head path in `modules.json`
Loading the model with Sentence Transformers currently fails:
from sentence_transformers import CrossEncoder
model = CrossEncoder("Qwen/Qwen3-VL-Reranker-8B")
# TypeError: LogitScore.__init__() missing 1 required positional argument: 'true_token_id'
modules.json points the score head to 1_CausalScoreHead, but the folder in the repository is 1_LogitScore
(containing {"true_token_id": 9693, "false_token_id": 2152}). Since no config is found for the head, LogitScore is
constructed without true_token_id. Qwen/Qwen3-VL-Reranker-2B uses "path": "1_LogitScore" and loads fine.
This PR points the score head to the existing folder:
{
"idx": 1,
"name": "1",
- "path": "1_CausalScoreHead",
+ "path": "1_LogitScore",
"type": "sentence_transformers.cross_encoder.modules.logit_score.LogitScore"
}
With this change the model loads and the head gets true_token_id=9693 / false_token_id=2152.
Reproduced on b212dc8c91a8164aef1ea2de9c1a867611e75c04 (current main) with sentence-transformers 6.1.0 / transformers 5.19.0,
and with sentence-transformers 5.7.0.