Update README.md
Browse files
README.md
CHANGED
@@ -21,8 +21,8 @@ def rerank(question, passages, normalize_scores=True):
|
|
21 |
templates = [f"Query: {question}\nSentence: {passage}" for passage in passages]
|
22 |
encoded_inputs = reranker_tokenizer.encode_batch(templates)
|
23 |
|
24 |
-
# Convert to lists and truncate sequences to max length (
|
25 |
-
input_ids = [enc.ids[:
|
26 |
attention_mask = [[1] * len(ids) for ids in input_ids]
|
27 |
|
28 |
# Find max length in batch
|
|
|
21 |
templates = [f"Query: {question}\nSentence: {passage}" for passage in passages]
|
22 |
encoded_inputs = reranker_tokenizer.encode_batch(templates)
|
23 |
|
24 |
+
# Convert to lists and truncate sequences to max length (32768)
|
25 |
+
input_ids = [enc.ids[:32768] for enc in encoded_inputs] # Truncate here
|
26 |
attention_mask = [[1] * len(ids) for ids in input_ids]
|
27 |
|
28 |
# Find max length in batch
|