-
Notifications
You must be signed in to change notification settings - Fork 46
adds custom vectorizer support #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few suggestions
|
||
super().__init__(model=model, dims=self._set_model_dims()) | ||
|
||
def _validate_embed(self, func: Callable): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this is wrapping a pydantic BaseModel
object, these validators should be implemented using the validator
operators. (there should be some other examples of this here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrapping these with @validator
decorators calls them before the embed methods are set in super().__init__
. Pydantic enforces a certain order in initialization so we end up getting trapped in a circular dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine for now, but we will look at this later though (maybe for 0.3.0) because I believe we can find a cleaner way to use built-in validation, pre or post init.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few more tweaks to the notebook
@justin-cechmanek Can you work on rebasing these changes on top of main? Then we can get this in today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
This PR introduces a new CustomTextVectorizer class that allows for users to wrap their own embedding functions and methods to be compatible with RedisVL.