Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The tuple-batch behavior is covered across supported input sizes and execution modes, with no established current-head defect. 🚥 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 |
|
Hey, thanks for pointing it out. To be honest, the methods signature are a bit broader than what we actually support. We support lists, iterables and generators, all the other types are supported indirectly, and this particular fix looks somewhat ugly, since the condition is so long and checks the length with a magic (maybe not super magic) integer. |
rerank_pairs()accepts an iterable of query/document pairs, but currently wraps every tuple as a single pair. Passing((query, doc1), (query, doc2)), a one-element tuple, or an empty tuple raises a tokenizerTypeError.Only wrap a tuple containing two strings as the existing single-pair shorthand. Treat tuple batches like lists when choosing the small-batch path. The regression tests cover 0–3 pairs with sequential and parallel execution, plus the existing single-pair behavior, using the real MiniLM reranker and canonical scores.
Validation
pytest tests/test_text_cross_encoder.py tests/test_common.py -q: 19 passed, with both current compatible dependencies and the Python 3.12 versions selected frompoetry.lock.mypy fastembed --disallow-incomplete-defs --disallow-untyped-defs --disable-error-code=import-untypedpasses for all 64 source files;pyright tests/type_stub.pyandruff check fastembed testspass.git diff --checkpasses.The full model suite and other OS/Python combinations were not run. Broader Ruff checks report the same existing formatting and experiment-notebook lint findings on unchanged main; resolving the newest dependencies also exposes five existing mypy errors outside this change. These are unchanged by this patch.
Prepared with AI assistance from Codex.