Fix model loading from stream (#7067)
Fix bug introduced in 17913713b554d820a8ce94226d854b4a5f1d8bbc (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:
parent
6bcbc77226
commit
46c46829ce
@ -61,7 +61,7 @@ public class XGBoost {
|
||||
os.write(buf, 0, size);
|
||||
}
|
||||
in.close();
|
||||
return Booster.loadModel(buf);
|
||||
return Booster.loadModel(os.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user