Handle formatted JSON input. (#7953)

This commit is contained in:
Jiaming Yuan
2022-06-01 16:20:58 +08:00
committed by GitHub
parent d3429f2ff6
commit 13b15e07e8
3 changed files with 22 additions and 3 deletions

View File

@@ -920,7 +920,6 @@ XGB_DLL int XGBoosterLoadModel(BoosterHandle handle, const char* fname) {
auto str = common::LoadSequentialFile(fname);
CHECK_GE(str.size(), 3); // "{}\0"
CHECK_EQ(str[0], '{');
CHECK_EQ(str[str.size() - 2], '}');
return str;
};
if (common::FileExtension(fname) == "json") {