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: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR changes how Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
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.