From 6f424d8d6c90d095e9e0760c6aa7bc31ed4c6e66 Mon Sep 17 00:00:00 2001 From: Philip Hyunsu Cho Date: Wed, 18 May 2022 17:02:36 -0700 Subject: [PATCH] [Doc] Warn against loading JSON from external source (#7918) --- doc/tutorials/saving_model.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/tutorials/saving_model.rst b/doc/tutorials/saving_model.rst index 723cde431..87e54054c 100644 --- a/doc/tutorials/saving_model.rst +++ b/doc/tutorials/saving_model.rst @@ -68,6 +68,12 @@ a filename with ``.json`` or ``.ubj`` as file extension, the latter is the exten xgb.save(bst, 'model_file_name.json') +.. note:: + + Only load models from JSON files that were produced by XGBoost. Attempting to load + JSON files that were produced by an external source may lead to undefined behaviors + and crashes. + While for memory snapshot, UBJSON is the default starting with xgboost 1.6. ***************************************************************