fix(reranker): score passages with tokenizer text pairs#125
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the CrossEncoderTokenizer interface and its usage in the reranker to align with Hugging Face Transformers tokenizer options, refactors release tests to dynamically use the package version instead of hardcoded strings, and introduces path normalization in contextbench tests to ensure consistent path comparisons. Feedback suggests correcting return_tensor to return_tensors in the tokenizer interface and safely handling an optional options parameter in the test mock to avoid potential runtime errors.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
acb7cba to
e1ba165
Compare
The released branch was loading transformers 3.8.1 correctly, but the reranker was calling the tokenizer in a shape that ignored the passage. Keep the dependency on the released package version and make the recovery test assert the text_pair call so this does not slip back.
The repo is already on 2.3.0, but the release truth test and manual publish fallback were still pinned to 2.2.0. Derive the assertions from package metadata and normalize macOS temp paths so the full suite checks the real contract instead of local path spelling.
e1ba165 to
b51adeb
Compare
Note
This PR should be merged before the NestJS analyzer work. The analyzer PR is stacked on top of this branch so the framework changes can be reviewed separately: aolin480/codebase-context-react-nextjs#3.
Summary
text_pairoption instead of the positional call shape.@huggingface/transformerson the released^3.8.1dependency while preserving the cache-corruption recovery path.2.3.0release surfaces and macOS path canonicalization.Verification
pnpm run type-checkpnpm run buildpnpm run format:checkpnpm testv24.15.0with@huggingface/transformers@3.8.1Notes
@huggingface/transformers.3.8.1loads the reranker and embedding models; the issue was the tokenizer call shape, not the package version.