-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add custom model #463
base: main
Are you sure you want to change the base?
Add custom model #463
Conversation
@classmethod | ||
def add_custom_model(cls, model_info: dict[str, Any]): | ||
cls.supported_models.append(model_info) |
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.
there is no need to redefine this method in the subclasses if they fetch the right cls variable
"description": "...", | ||
"license": "apache-2.0", | ||
"size_in_GB": 1.23, | ||
"sources": { ... } # optional |
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.
Shouldn't that be mandatory ? We use sources to download model/config.
"sources": { ... } # optional | |
"sources": { | |
"hf": "alibaba/blablabla" | |
} |
PooledEmbedding.add_custom_model(model_info) | ||
elif mean_pooling and normalization: | ||
PooledNormalizedEmbedding.add_custom_model(model_info) | ||
elif "clip" in model_info["model"].lower(): |
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.
This is not always the case. jinaai/jina-clip-v1
model is added to text models (not clip) as it needs normalization.
elif "clip" in model_info["model"].lower(): | |
elif "clip" in model_info["model"].lower() and not normalization: |
Add custom models to fastembed.text