Add custom model#463
Closed
I8dNLo wants to merge 4 commits into
Closed
Conversation
joein
reviewed
Feb 10, 2025
Comment on lines
+108
to
+110
| @classmethod | ||
| def add_custom_model(cls, model_info: dict[str, Any]): | ||
| cls.supported_models.append(model_info) |
Member
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
Shouldn't that be mandatory ? We use sources to download model/config.
Suggested change
| "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(): |
Contributor
There was a problem hiding this comment.
This is not always the case. jinaai/jina-clip-v1 model is added to text models (not clip) as it needs normalization.
Suggested change
| elif "clip" in model_info["model"].lower(): | |
| elif "clip" in model_info["model"].lower() and not normalization: |
Member
|
closed in favour of #479 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add custom models to fastembed.text