fix case insensitive lookup for custom text models - #645
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: ➖ Normal Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The change correctly supports mixed-case custom model construction and adds regression coverage without leaving a concrete merge-blocking risk. 🚥 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 #650
Checklist
Summary
Custom models can be registered using one casing (e.g.
Org/Model) and later instantiated using a different casing (e.g.org/model).TextEmbeddingalready resolves models case-insensitively, butCustomTextEmbeddinglater looked up the postprocessing configuration using the original user-provided model name, which could result in aKeyError.This change uses the canonical resolved model name from
self.model_description.modelwhen retrieving the postprocessing configuration.Changes
Reproduction
Before
Org/Model.TextEmbedding("org/model").KeyError.After
Org/Model.TextEmbedding("org/model").Testing
test_custom_text_model_lookup_is_case_insensitive.