-
Notifications
You must be signed in to change notification settings - Fork 138
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 more pooling method and refactor #672
Conversation
Signed-off-by: Yaliang Wu <[email protected]>
if (!"mean".equals(poolingMode) | ||
&& !"max".equals(poolingMode) | ||
&& !"cls".equals(poolingMode) | ||
&& !"mean_sqrt_len".equals(poolingMode) | ||
&& !"weightedmean".equals(poolingMode)) { |
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.
How about using !EnumSet.allOf(PoolingMethod.class).contains(poolingMode);?
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 to keep consistent with DJL code. When DJL team release this translator in future, we will delete this class and use DJL text embedding translator class which doesn't have PoolingMethod enum.
Signed-off-by: Yaliang Wu <[email protected]>
Codecov Report
@@ Coverage Diff @@
## 2.x #672 +/- ##
============================================
- Coverage 83.46% 83.22% -0.25%
+ Complexity 996 992 -4
============================================
Files 93 93
Lines 3660 3660
Branches 342 342
============================================
- Hits 3055 3046 -9
- Misses 460 467 +7
- Partials 145 147 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
* add more pooling method and refactor Signed-off-by: Yaliang Wu <[email protected]> * rename poolingMethod to poolingMode Signed-off-by: Yaliang Wu <[email protected]> Signed-off-by: Yaliang Wu <[email protected]> (cherry picked from commit d7f3c86)
* add more pooling method and refactor Signed-off-by: Yaliang Wu <[email protected]> * rename poolingMethod to poolingMode Signed-off-by: Yaliang Wu <[email protected]> Signed-off-by: Yaliang Wu <[email protected]> (cherry picked from commit d7f3c86) Co-authored-by: Yaliang Wu <[email protected]>
* add more pooling method and refactor Signed-off-by: Yaliang Wu <[email protected]> * rename poolingMethod to poolingMode Signed-off-by: Yaliang Wu <[email protected]> Signed-off-by: Yaliang Wu <[email protected]>
* add more pooling method and refactor Signed-off-by: Yaliang Wu <[email protected]> * rename poolingMethod to poolingMode Signed-off-by: Yaliang Wu <[email protected]> Signed-off-by: Yaliang Wu <[email protected]>
* add more pooling method and refactor * rename poolingMethod to poolingMode Signed-off-by: Yaliang Wu <[email protected]>
Signed-off-by: Yaliang Wu [email protected]
Description
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.