Repository navigation
fix: score a tuple of pairs in rerank_pairs instead of treating it as one pair - #797
michaelkillgta wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Tuples of query-document pairs are now scored like equivalent lists, and a single (query, document) tuple still works. No merge-blocking risk was identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #796
OnnxCrossEncoderModel._rerank_pairstreated everytupleinput as a single(query, document)pair and wrapped it in a list. A tuple of pairs (still a validIterable[tuple[str, str]]) became one malformed pair, and the tokenizer raisedTypeError: TextInputSequence must be str.Change
(query, document)tuple is unchanged.Test
test_rerank_pairs_tuple_inputchecks that a tuple of two pairs and a tuple of three pairs give the same scores as the equivalent list, and that a single pair still works. It fails onmainwith theTypeErrorabove and passes with this change.All Submissions:
New Feature Submissions:
pre-commit...? (Not installed as a hook. I ran the pinned ruff 0.3.4 check and format directly.)Local runs:
tests/test_text_cross_encoder.pyandtests/test_custom_models.pygive 15 passed. The one failure,test_rerank, already fails onmainon my machine because of thebge-reranker-v2-m3-int8canonical scores, so it is unrelated.ruff0.3.4 (the pre-commit pin) check and format pass, andmypy fastembedwith the CI flags passes.