Spaces:
Sleeping
Sleeping
Upload reranker.py with huggingface_hub
Browse files- reranker.py +3 -2
reranker.py
CHANGED
|
@@ -4,8 +4,9 @@ from transformers import AutoModel, AutoTokenizer, AutoModelForCausalLM
|
|
| 4 |
class Reranker:
|
| 5 |
|
| 6 |
def __init__(self):
|
| 7 |
-
|
| 8 |
-
self.
|
|
|
|
| 9 |
|
| 10 |
def format_instruction(self,instruction, query, doc):
|
| 11 |
if instruction is None:
|
|
|
|
| 4 |
class Reranker:
|
| 5 |
|
| 6 |
def __init__(self):
|
| 7 |
+
# Koristi 0.6B model umesto 4B zbog manje memorije
|
| 8 |
+
self.tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-Reranker-0.6B", padding_side='left')
|
| 9 |
+
self.model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-Reranker-0.6B").eval()
|
| 10 |
|
| 11 |
def format_instruction(self,instruction, query, doc):
|
| 12 |
if instruction is None:
|