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

[jvm] Add ability to load booster direct from byte array #6655

Merged
merged 3 commits into from Feb 23, 2021

Conversation

honzasterba
Copy link
Contributor

No description provided.

@codecov-io
Copy link

Codecov Report

Merging #6655 (2bb25b7) into master (c3c8e66) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6655   +/-   ##
=======================================
  Coverage   81.01%   81.01%           
=======================================
  Files          13       13           
  Lines        3703     3703           
=======================================
  Hits         3000     3000           
  Misses        703      703           

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 c3c8e66...2bb25b7. Read the comment docs.

@honzasterba
Copy link
Contributor Author

@CodingCat please advise if there is anything else I should do to get this merged, thanks!

@trivialfis
Copy link
Member

@wbo4958 Could you please help taking a look?

@@ -85,11 +85,26 @@ static Booster loadModel(InputStream in) throws XGBoostError, IOException {
os.write(buf, 0, size);
}
in.close();
Booster ret = new Booster(new HashMap<String, Object>(), new DMatrix[0]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can delete

static Booster loadModel(InputStream in) throws XGBoostError, IOException {

and move the logic (getting buffer from InputStream) into XGBoost.java

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -61,6 +61,20 @@ public static Booster loadModel(InputStream in)
return Booster.loadModel(in);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can add the logic converting InputStream into byte[] here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on this

@CodingCat CodingCat merged commit 1791371 into dmlc:master Feb 23, 2021
@CodingCat
Copy link
Member

merged, thanks!

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.

None yet

5 participants