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.
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
asymmetric embeddings #2123
asymmetric embeddings #2123
Changes from all commits
5472f2d
dd539bb
10ffb1f
f4eaa27
276ede8
2a83cce
247a1c7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 48 in common/src/main/java/org/opensearch/ml/common/dataset/AsymmetricTextEmbeddingParameters.java
Codecov / codecov/patch
common/src/main/java/org/opensearch/ml/common/dataset/AsymmetricTextEmbeddingParameters.java#L48
Check warning on line 74 in common/src/main/java/org/opensearch/ml/common/dataset/AsymmetricTextEmbeddingParameters.java
Codecov / codecov/patch
common/src/main/java/org/opensearch/ml/common/dataset/AsymmetricTextEmbeddingParameters.java#L74
Check warning on line 88 in common/src/main/java/org/opensearch/ml/common/dataset/AsymmetricTextEmbeddingParameters.java
Codecov / codecov/patch
common/src/main/java/org/opensearch/ml/common/dataset/AsymmetricTextEmbeddingParameters.java#L88
Check warning on line 93 in common/src/main/java/org/opensearch/ml/common/dataset/AsymmetricTextEmbeddingParameters.java
Codecov / codecov/patch
common/src/main/java/org/opensearch/ml/common/dataset/AsymmetricTextEmbeddingParameters.java#L93
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.
Why not add a check function here to ensure at least one of the new parameters is not Null? It looks like this check can avoid problems later in loading the asymmetric model.
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.
TextEmbeddingModelConfig
is used for both asymmetric and symmetric models. Symmetric models don't have prefixes. The alternative would be to create a newTextEmbeddingModelConfig
class for asymmetric models. I don't think this would be a cleaner solution, tbh.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.
We can focus more on the feature itself in this PR. But later when we release this in new version. We should add version check. @b4sjoo Can you help when release new version.
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.
Both
queryPrefix
andpassagePrefix
are optional, so this shouldn't break compatibility. Are you sure there is need for a version check?Check warning on line 140 in ml-algorithms/src/main/java/org/opensearch/ml/engine/ModelHelper.java
Codecov / codecov/patch
ml-algorithms/src/main/java/org/opensearch/ml/engine/ModelHelper.java#L139-L140
Check warning on line 143 in ml-algorithms/src/main/java/org/opensearch/ml/engine/ModelHelper.java
Codecov / codecov/patch
ml-algorithms/src/main/java/org/opensearch/ml/engine/ModelHelper.java#L142-L143