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

make SpProcessor public #1060

Merged
merged 2 commits into from
Jun 29, 2021
Merged

Conversation

lanking520
Copy link
Contributor

Description

Per customer demand, make SpProcessor public to achieve better performance

@frankfliu
Copy link
Contributor

frankfliu commented Jun 29, 2021

We should make SpTokenizer.getProcessor() public as well.

I think creation of SpProcessor should always through SpTokenizer.
We can keep newInstance() and loadModel package protected.

Or, we merge newInstance() and SpTokenizer.loadModel(Path path, String prifix) into single API, and we can make it public

@codecov-commenter
Copy link

codecov-commenter commented Jun 29, 2021

Codecov Report

Merging #1060 (6247148) into master (05ad89a) will decrease coverage by 0.36%.
The diff coverage is 63.31%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1060      +/-   ##
============================================
- Coverage     70.36%   70.00%   -0.37%     
- Complexity     5085     5213     +128     
============================================
  Files           501      510       +9     
  Lines         22415    23255     +840     
  Branches       2325     2489     +164     
============================================
+ Hits          15772    16279     +507     
- Misses         5403     5647     +244     
- Partials       1240     1329      +89     
Impacted Files Coverage Δ
api/src/main/java/ai/djl/Device.java 71.11% <ø> (+0.89%) ⬆️
api/src/main/java/ai/djl/ndarray/NDArray.java 73.25% <0.00%> (-1.31%) ⬇️
.../java/ai/djl/repository/RepositoryFactoryImpl.java 76.74% <0.00%> (-1.83%) ⬇️
.../src/main/java/ai/djl/repository/zoo/ModelZoo.java 54.00% <0.00%> (-18.81%) ⬇️
api/src/main/java/ai/djl/util/Platform.java 45.65% <0.00%> (-3.19%) ⬇️
.../main/java/ai/djl/zero/cv/ImageClassification.java 0.00% <0.00%> (ø)
...rc/main/java/ai/djl/sentencepiece/SpProcessor.java 77.27% <ø> (ø)
...rc/main/java/ai/djl/sentencepiece/SpTokenizer.java 63.63% <ø> (ø)
...ine/src/main/java/ai/djl/mxnet/engine/MxModel.java 61.11% <ø> (-1.06%) ⬇️
...src/main/java/ai/djl/mxnet/engine/MxNDArrayEx.java 87.77% <ø> (ø)
... and 128 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 45ac6ed...6247148. Read the comment docs.

@lanking520 lanking520 merged commit 8b36318 into deepjavalibrary:master Jun 29, 2021
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.

3 participants