From b21ac274a57d8a2c6ffeb976478d9fa8fc736b48 Mon Sep 17 00:00:00 2001
From: Philip Abbet <philip.abbet@idiap.ch>
Date: Wed, 13 Dec 2023 16:45:50 +0100
Subject: [PATCH] [scripts.predict] Fix call to 'load_from_checkpoint()'

Since lightning 2.1.0, the error "The classmethod `Pasa.load_from_checkpoint`
cannot be called on an instance." was returned when this method was called,
making the tests fail.
---
 src/ptbench/scripts/predict.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ptbench/scripts/predict.py b/src/ptbench/scripts/predict.py
index 054590e2..91b66d72 100644
--- a/src/ptbench/scripts/predict.py
+++ b/src/ptbench/scripts/predict.py
@@ -134,7 +134,7 @@ def predict(
     datamodule.setup(stage="predict")
 
     logger.info(f"Loading checkpoint from `{weight}`...")
-    model = model.load_from_checkpoint(weight, strict=False)
+    model = type(model).load_from_checkpoint(weight, strict=False)
 
     predictions = run(model, datamodule, DeviceManager(device))
 
-- 
GitLab