Add support for switching embedding models - #43
Conversation
|
I'm looking into the linter issue. I'm not sure how or why but I think the changes made by black and isort may be conflicting with each other. For example, running black . and then black --check . passes. Then running isort . and running black --check . again fails. I will look into how to clean up this issue. |
|
@hinxcode in regards to the above black / isort compatibility issue, this configuration setting might fix the issue: https://pycqa.github.io/isort/docs/configuration/black_compatibility.html Let me know if this solution is workable or if I should look into other ways to fix the issue perhaps finding a way to refactor my code. Thanks! |
hinxcode
left a comment
There was a problem hiding this comment.
LGTM. Will open a follow-up PR for a few smaller cleanup items from review (pyproject.toml, factory singleton, SigLIP scoring formula). Thanks for the work!
Description
This update adds a new base class to support switching between different embedding models by setting
model_typeandmodel_namein the config. The SigLIP embedding model is now supported. Additional embedding models can be supported similarly by writing a new embedding model subclass. Also this update adds support for Mac GPU devices by setting "mps" in the config.Motivation and Context
Type of Change
Component(s) Affected
Changes Made
Testing
How Has This Been Tested?
Test Configuration
openai/clip-vit-base-patch32google/siglip-base-patch16-256-multilingualScreenshots (if applicable)
N/A
Checklist
Code Quality
black .andisort .on Python codenpm run linton frontend code (if applicable)Testing
Documentation
config.jsondocumentation if config changes were madeDependencies
requirements.txt(if Python dependencies changed)package.json(if Node dependencies changed)Research (if applicable)
Breaking Changes
These changes are designed to be backwards compatible, even with older versions of configs without newly introduced properties
Additional Notes
If there is any interest, I can also work on adding classes for SigLIP2 and ColPali
Reviewers Checklist (for maintainers)