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
Conversation
Codecov Report
@@ 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.
|
@CodingCat please advise if there is anything else I should do to get this merged, thanks! |
@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]); |
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.
maybe we can delete
static Booster loadModel(InputStream in) throws XGBoostError, IOException {
and move the logic (getting buffer from InputStream) into XGBoost.java
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.
done
@@ -61,6 +61,20 @@ public static Booster loadModel(InputStream in) | |||
return Booster.loadModel(in); |
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.
maybe we can add the logic converting InputStream into byte[] here
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.
+1 on this
- move it from Booster to XGBoost facade class
c950033
to
594e872
Compare
merged, thanks! |
No description provided.