| 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | # SPDX-FileCopyrightText: Copyright contributors to the vLLM project |
| 3 | import pytest |
| 4 | |
| 5 | from tests.models.utils import ( |
| 6 | RerankModelInfo, |
| 7 | ) |
| 8 | |
| 9 | from .mteb_score_utils import mteb_test_rerank_models |
| 10 | |
| 11 | RERANK_MODELS = [ |
| 12 | RerankModelInfo( |
| 13 | "cross-encoder/ms-marco-TinyBERT-L-2-v2", |
| 14 | architecture="BertForSequenceClassification", |
| 15 | seq_pooling_type="CLS", |
| 16 | attn_type="encoder_only", |
| 17 | is_prefix_caching_supported=False, |
| 18 | is_chunked_prefill_supported=False, |
| 19 | mteb_score=0.32898, |
| 20 | mteb_tol=1e-2, |
| 21 | ), |
| 22 | RerankModelInfo( |
| 23 | "tomaarsen/Qwen3-Reranker-0.6B-seq-cls", |
| 24 | architecture="Qwen3ForSequenceClassification", |
| 25 | seq_pooling_type="LAST", |
| 26 | attn_type="decoder", |
| 27 | is_prefix_caching_supported=True, |
| 28 | is_chunked_prefill_supported=True, |
| 29 | chat_template_name="qwen3_reranker.jinja", |
| 30 | mteb_score=0.33459, |
| 31 | mteb_tol=1e-2, |
| 32 | ), |
| 33 | ] |
| 34 | |
| 35 | |
| 36 | @pytest.mark.flaky(reruns=2) |
| 37 | @pytest.mark.parametrize("model_info", RERANK_MODELS) |
| 38 | def test_rerank_models_mteb(vllm_runner, model_info: RerankModelInfo) -> None: |
| 39 | mteb_test_rerank_models(vllm_runner, model_info) |