fix: set weights_only=False when loading from pytorch

closes #12964
This commit is contained in:
Matthias
2026-03-24 20:31:02 +01:00
parent 0a2c3379c6
commit e98959f3f0
+7 -3
View File
@@ -614,9 +614,13 @@ class FreqaiDataDrawer:
elif self.model_type == "pytorch": elif self.model_type == "pytorch":
import torch import torch
zipfile = torch.load(dk.data_path / f"{dk.model_filename}_model.zip") zipfile = torch.load(
model = zipfile["pytrainer"] dk.data_path / f"{dk.model_filename}_model.zip",
model = model.load_from_checkpoint(zipfile) weights_only=False,
)
# weights_only is necessary due to pytrainer being a serialized python object.
_trainer = zipfile["pytrainer"]
model = _trainer.load_from_checkpoint(zipfile)
if not model: if not model:
raise OperationalException( raise OperationalException(