From b4a384bb155a405f597ae02bb40a4e06a2aae15f Mon Sep 17 00:00:00 2001 From: Kevin Ta <116312994+kta-intel@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:36:59 -0500 Subject: [PATCH] [FeTS][GaNDLF] skip loading `train.csv` during inference mode (#1141) * remove train.csv path during inference step Signed-off-by: kta-intel * check inference during dataloader Signed-off-by: kta-intel * lint fix Signed-off-by: kta-intel --------- Signed-off-by: kta-intel --- openfl/federated/data/loader_gandlf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openfl/federated/data/loader_gandlf.py b/openfl/federated/data/loader_gandlf.py index 6e1a04342a..648ebe2930 100644 --- a/openfl/federated/data/loader_gandlf.py +++ b/openfl/federated/data/loader_gandlf.py @@ -25,7 +25,10 @@ def __init__(self, data_path, feature_shape): data_path (str): The path to the directory containing the data. feature_shape (tuple): The shape of an example feature array. """ - self.train_csv = data_path + "/train.csv" + if "inference" in data_path: + self.train_csv = None + else: + self.train_csv = data_path + "/train.csv" self.val_csv = data_path + "/valid.csv" self.train_dataloader = None self.val_dataloader = None