Skip to content

Commit bd59d59

Browse files
committed
handle augment electra and old ckpt files
1 parent 5a17f72 commit bd59d59

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

chebai/result/prediction.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ def __init__(
3737

3838
self._dm_hparams = ckpt_file["datamodule_hyper_parameters"]
3939
self._dm_hparams.pop("splits_file_path")
40+
self._dm_hparams.pop("augment_smiles", None)
41+
self._dm_hparams.pop("aug_smiles_variations", None)
42+
assert "_class_path" in self._dm_hparams, (
43+
"Datamodule hyperparameters must include a '_class_path' key.\n"
44+
"Hence, either the checkpoint is corrupted or "
45+
"it was not saved properly with latest lightning version"
46+
)
4047
self._dm: XYBaseDataModule = instantiate_module(
4148
XYBaseDataModule, self._dm_hparams
4249
)

0 commit comments

Comments
 (0)