Fix model loading from stream (#7067)
Fix bug introduced in 17913713b5 (allow loading from byte array)
When loading model from stream, only last buffer read from the input stream is used to construct the model.
This may work for models smaller than 1 MiB (if you are lucky enough to read the whole model at once), but will always fail if the model is larger.
This commit is contained in:
@@ -61,7 +61,7 @@ public class XGBoost {
|
||||
os.write(buf, 0, size);
|
||||
}
|
||||
in.close();
|
||||
return Booster.loadModel(buf);
|
||||
return Booster.loadModel(os.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user