From 29c527097265dd1c14c4f40799da631f5d5249e1 Mon Sep 17 00:00:00 2001 From: Florencia Date: Fri, 28 Jun 2024 08:47:39 +0200 Subject: [PATCH] Validation on loading model --- challenge/model.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/challenge/model.py b/challenge/model.py index fd33ded..0b9ac98 100644 --- a/challenge/model.py +++ b/challenge/model.py @@ -150,5 +150,7 @@ def predict( Returns: (List[int]): predicted targets. """ + if self._model is None: + self.__load_model(MODEL_PATH) predictions = self._model.predict(features) return predictions.tolist()