MCPcopy Index your code
hub / github.com/CompVis/zigma / load

Method load

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

Source from the content-addressed store, hash-verified

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}")
41 self.step = torch.load(os.path.join(path, "step.pth"))
42 for key, val in self.__dict__.items():
43 if key != "step" and val is not None:
44 val.load_state_dict(
45 torch.load(os.path.join(path, f"{key}.pth"), map_location="cpu")
46 )
47
48 def resume(self, ckpt_root, step=None):
49 if not os.path.exists(ckpt_root):

Callers 14

resumeMethod · 0.95
mainFunction · 0.80
mainFunction · 0.80
setupMethod · 0.80
__init__Method · 0.80
_layer_norm_bwd_kernelFunction · 0.80
load_config_hfFunction · 0.80
load_state_dict_hfFunction · 0.80
wds_dataloader.pyFile · 0.80

Calls

no outgoing calls

Tested by 1