Skip to content
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

[Backport 2.x] Add cross encoder support #1739

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport 2761d7d from #1615

* add text similarity inputs and function name

Signed-off-by: HenryL27 <[email protected]>

* add text similarity cross encoder model

Signed-off-by: HenryL27 <[email protected]>

* add text similarity unit tests

Signed-off-by: HenryL27 <[email protected]>

* add text similarity input unittests

Signed-off-by: HenryL27 <[email protected]>

* add text similarity dataset unittests

Signed-off-by: HenryL27 <[email protected]>

* add function name annotation

Signed-off-by: HenryL27 <[email protected]>

* refactor API to use single query

Signed-off-by: HenryL27 <[email protected]>

* omit private from class vars

Co-authored-by: Navneet Verma <[email protected]>
Signed-off-by: HenryL27 <[email protected]>

* change output name from logits to similarity

Signed-off-by: HenryL27 <[email protected]>

* hashify isDLModel

Signed-off-by: HenryL27 <[email protected]>

* add error message for non-torchscript cross encoders

Signed-off-by: HenryL27 <[email protected]>

* allow onnx, actually.

Signed-off-by: HenryL27 <[email protected]>

* apply spotless after rebase

Signed-off-by: HenryL27 <[email protected]>

* add unittest for new mlinput toXcontent clause

Signed-off-by: HenryL27 <[email protected]>

* static DLModels

Signed-off-by: HenryL27 <[email protected]>

* add tests and error message tweaks

Signed-off-by: HenryL27 <[email protected]>

* name test models w framework

Signed-off-by: HenryL27 <[email protected]>

* change pt->torch_script

Signed-off-by: HenryL27 <[email protected]>

---------

Signed-off-by: HenryL27 <[email protected]>
Co-authored-by: Navneet Verma <[email protected]>
(cherry picked from commit 2761d7d)
Copy link

codecov bot commented Dec 7, 2023

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (ab9c717) 81.19% compared to head (8b24a92) 81.33%.

Files Patch % Lines
...rch/ml/common/input/nlp/TextSimilarityMLInput.java 86.95% 2 Missing and 4 partials ⚠️
...n/java/org/opensearch/ml/common/input/MLInput.java 66.66% 3 Missing and 2 partials ⚠️
...in/java/org/opensearch/ml/common/FunctionName.java 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                2.x    #1739      +/-   ##
============================================
+ Coverage     81.19%   81.33%   +0.14%     
- Complexity     4343     4375      +32     
============================================
  Files           421      425       +4     
  Lines         17333    17478     +145     
  Branches       1832     1849      +17     
============================================
+ Hits          14073    14216     +143     
+ Misses         2543     2537       -6     
- Partials        717      725       +8     
Flag Coverage Δ
ml-commons 81.33% <91.83%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dhrubo-os dhrubo-os merged commit 16e2cdf into 2.x Dec 7, 2023
12 of 15 checks passed
@github-actions github-actions bot deleted the backport/backport-1615-to-2.x branch December 7, 2023 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants