Repository navigation
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: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Case-only duplicate names are rejected, and no issue requiring a fix before merge is identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
TextCrossEncoder.add_custom_model checks duplicate names case-sensitively, while model selection and description lookup compare lowercase names. Registering a case-only variant is accepted but resolves to the earlier entry, silently selecting its original source. Case-only aliases of built-in names are affected as well.
Use the same lowercase comparison during registration and raise the existing duplicate-name ValueError. Document that model names must be unique regardless of case. Tests cover built-in and custom names, four case variants, registry preservation on rejection, and actual lazy construction of distinct custom models with case-variant names and the expected sources. This aligns with the existing TextEmbedding.add_custom_model behavior rather than changing model lookup semantics.
Validation
All Submissions
New-feature and new-model checklist items are not applicable to this bug fix. No pre-commit hook was installed for this uncommitted preview; its configured Ruff checks were run directly.
AI assistance: the patch and tests were prepared with Codex and reviewed and approved for submission by the contributor.
No separate issue has been opened.
Additional offline public-API verification: register differently cased names with different sources, then construct TextCrossEncoder with lazy_load and a local model path. The baseline accepts the alias but selects the first source; the patch rejects the duplicate and still constructs the original model correctly. No ONNX inference was run.