Selennnn commited on
Commit
c15ca2d
·
verified ·
1 Parent(s): e946ffc

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +107 -40
README.md CHANGED
@@ -1,62 +1,129 @@
1
  ---
2
- library_name: sentence-transformers
3
  license: apache-2.0
 
 
4
  base_model:
5
  - Qwen/Qwen3-VL-Reranker-8B
6
  pipeline_tag: text-ranking
 
7
  tags:
8
- - supertron2
9
- - reranker
10
- - qwen3-vl
11
- - text-ranking
12
  - cross-encoder
13
- language:
14
- - en
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  ---
16
 
17
- # Supertron2-Reranker-8B
 
 
 
 
 
 
 
 
18
 
19
- Supertron2-Reranker-8B is a short fine-tune of `Qwen/Qwen3-VL-Reranker-8B` for text reranking.
20
 
21
- It is trained on real reranking pairs, primarily MS MARCO, for search and RAG reranking.
22
 
23
- ## Usage
 
 
 
 
 
 
24
 
25
  ```python
26
- import torch
27
- from transformers import AutoModelForImageTextToText, AutoProcessor
28
 
29
  model_id = "Surpem/Supertron2-Reranker-8B"
30
- processor = AutoProcessor.from_pretrained(model_id)
31
- model = AutoModelForImageTextToText.from_pretrained(
32
- model_id,
33
- torch_dtype=torch.bfloat16,
34
- device_map="auto",
35
- )
36
-
37
- query = "What is the capital of France?"
38
- documents = ["Paris is the capital of France.", "Mars is the red planet."]
39
- prompts = [
40
- f"Retrieve text relevant to the user's query.
41
- Query: {query}
42
-
43
- "
44
- f"Document: {document}
45
-
46
- "
47
- "Is this document relevant to the query? Answer yes or no:"
48
- for document in documents
49
  ]
50
- inputs = processor(text=prompts, padding=True, return_tensors="pt").to(model.device)
51
- yes_id = processor.tokenizer.encode("yes", add_special_tokens=False)[-1]
52
- no_id = processor.tokenizer.encode("no", add_special_tokens=False)[-1]
53
 
54
- with torch.inference_mode():
55
- logits = model(**inputs, return_dict=True, logits_to_keep=1).logits[:, -1, :]
56
- scores = (logits[:, yes_id] - logits[:, no_id]).float()
57
  print(scores)
58
  ```
59
 
60
- ## Limitations
61
 
62
- This is a short 30-minute H100 fine-tune. It should be evaluated on your retrieval domain before production use.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
 
2
  license: apache-2.0
3
+ language:
4
+ - en
5
  base_model:
6
  - Qwen/Qwen3-VL-Reranker-8B
7
  pipeline_tag: text-ranking
8
+ library_name: sentence-transformers
9
  tags:
10
+ - reranking
11
+ - retrieval
12
+ - rag
 
13
  - cross-encoder
14
+ - qwen3-vl
15
+ - pytorch
16
+ ---
17
+
18
+ # **Supertron2-Reranker-8B: A Compact Cross-Encoder Reranking Model**
19
+
20
+ ## **Model Description**
21
+
22
+ **Supertron2-Reranker-8B** is a reranking model built on top of [Qwen/Qwen3-VL-Reranker-8B](https://huggingface.co/Qwen/Qwen3-VL-Reranker-8B). It is designed to score query-document pairs for retrieval pipelines, search systems, and RAG applications where a stronger second-stage ranker is useful.
23
+
24
+ * **Developed by:** Surpem
25
+ * **Model type:** Cross-Encoder Reranker
26
+ * **Architecture:** Qwen3-VL reranker, 8B parameters
27
+ * **License:** Apache 2.0
28
+
29
  ---
30
 
31
+ ## **Capabilities**
32
+
33
+ ### **Search Reranking**
34
+
35
+ Supertron2-Reranker-8B can compare a user query against candidate passages and assign relevance scores. It is intended as a second-stage reranker after a faster retriever has already selected candidate documents.
36
+
37
+ ### **RAG Pipelines**
38
+
39
+ The model can help improve retrieval-augmented generation by pushing more relevant documents toward the top of the context window before answer generation.
40
 
41
+ ### **Question-Document Matching**
42
 
43
+ Supertron2-Reranker-8B is useful for matching questions to passages, snippets, help-center articles, documentation chunks, and other text candidates.
44
 
45
+ ### **Instruction-Aware Retrieval**
46
+
47
+ The model is prompted for relevance scoring, making it suitable for natural language search tasks where query intent matters.
48
+
49
+ ---
50
+
51
+ ## **Get Started**
52
 
53
  ```python
54
+ from sentence_transformers import CrossEncoder
 
55
 
56
  model_id = "Surpem/Supertron2-Reranker-8B"
57
+
58
+ model = CrossEncoder(model_id)
59
+
60
+ pairs = [
61
+ ("What is the capital of France?", "Paris is the capital and largest city of France."),
62
+ ("What is the capital of France?", "Mars is often called the red planet."),
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  ]
 
 
 
64
 
65
+ scores = model.predict(pairs)
 
 
66
  print(scores)
67
  ```
68
 
69
+ Example reranking:
70
 
71
+ ```python
72
+ query = "How do I reset my password?"
73
+ documents = [
74
+ "Use the account recovery page to reset your password.",
75
+ "Our refund policy allows returns within 30 days.",
76
+ "Two-factor authentication adds extra login security.",
77
+ ]
78
+
79
+ results = model.rank(query, documents)
80
+ print(results)
81
+ ```
82
+
83
+ ---
84
+
85
+ ## **Hardware Requirements**
86
+
87
+ | Precision | Min VRAM | Recommended |
88
+ |---|---|---|
89
+ | bfloat16 | 18 GB | 24 GB+ |
90
+ | 4-bit quantized | 6 GB | 10 GB+ |
91
+
92
+ For larger batches or long documents, use more VRAM or reduce the batch size/max sequence length.
93
+
94
+ ---
95
+
96
+ ## **Intended Use**
97
+
98
+ Supertron2-Reranker-8B is intended for:
99
+
100
+ * Search reranking
101
+ * RAG document reranking
102
+ * Query-passage relevance scoring
103
+ * Documentation and knowledge-base retrieval
104
+ * Evaluation of candidate retrieval results
105
+
106
+ It is not intended to be used as a standalone chat model.
107
+
108
+ ---
109
+
110
+ ## **Limitations**
111
+
112
+ * The model scores relevance; it does not generate answers.
113
+ * It should be evaluated on your own retrieval domain before production use.
114
+ * Long documents may need chunking before reranking.
115
+ * Relevance scores are relative and may not be calibrated across unrelated queries.
116
+ * The model may still rank incorrect, outdated, or unsafe content highly if it appears textually relevant.
117
+
118
+ ---
119
+
120
+ ## **Citation**
121
+
122
+ ```bibtex
123
+ @misc{surpem2026supertron2-reranker-8b,
124
+ title={Supertron2-Reranker-8B -- Compact Cross-Encoder Reranking Model},
125
+ author={Surpem},
126
+ year={2026},
127
+ url={https://huggingface.co/Surpem/Supertron2-Reranker-8B},
128
+ }
129
+ ```