@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user