MCPcopy Create free account
hub / github.com/CompVis/zigma / save

Method save

utils/train_state_utils.py:32–37  ·  view source on GitHub ↗
(self, path)

Source from the content-addressed store, hash-verified

30 ema(self.model_ema, self.model, rate)
31
32 def save(self, path):
33 os.makedirs(path, exist_ok=True)
34 torch.save(self.step, os.path.join(path, "step.pth"))
35 for key, val in self.__dict__.items():
36 if key != "step" and val is not None:
37 torch.save(val.state_dict(), os.path.join(path, f"{key}.pth"))
38
39 def load(self, path):
40 logging.info(f"load from {path}")

Callers 3

mainFunction · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by 1