Skip to content

Commit e63c4f6

Browse files
Fix xgboost model overwrite (#2663)
1 parent 4f604bb commit e63c4f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nvflare/app_opt/xgboost/histogram_based_v2/adaptors/grpc_client_adaptor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ class since the self object contains a sender that contains a Core Cell which ca
6767
Returns: None
6868
6969
"""
70+
simulate_mode = fl_ctx.get_prop(FLContextKey.SIMULATE_MODE, False)
71+
model_dir = self._app_dir if simulate_mode else self._run_dir
7072
runner_ctx = {
7173
Constant.RUNNER_CTX_WORLD_SIZE: self.world_size,
7274
Constant.RUNNER_CTX_CLIENT_NAME: self._client_name,
@@ -76,7 +78,7 @@ class since the self object contains a sender that contains a Core Cell which ca
7678
Constant.RUNNER_CTX_TRAINING_MODE: self.training_mode,
7779
Constant.RUNNER_CTX_XGB_PARAMS: self.xgb_params,
7880
Constant.RUNNER_CTX_XGB_OPTIONS: self.xgb_options,
79-
Constant.RUNNER_CTX_MODEL_DIR: self._run_dir,
81+
Constant.RUNNER_CTX_MODEL_DIR: model_dir,
8082
Constant.RUNNER_CTX_TB_DIR: self._app_dir,
8183
}
8284
self.start_runner(runner_ctx, fl_ctx)

0 commit comments

Comments
 (0)