MCPcopy Create free account
hub / github.com/FreedomGu/Diffportrait360 / load

Function load

diffportrait360_release/code/utils/checkpoint.py:122–130  ·  view source on GitHub ↗

load model

(filepath: str, **kwargs)

Source from the content-addressed store, hash-verified

120
121# resuming training
122def load(filepath: str, **kwargs):
123 """ load model """
124 if not filepath.startswith("hdfs://"):
125 return torch.load(filepath, **kwargs)
126 with hopen(filepath, "rb") as reader:
127 accessor = io.BytesIO(reader.read())
128 state_dict = torch.load(accessor, **kwargs)
129 del accessor
130 return state_dict
131
132def load_from_pretrain(pretrain_path, map_location='cpu'):
133

Callers 1

load_from_pretrainFunction · 0.85

Calls 2

hopenFunction · 0.90
loadMethod · 0.45

Tested by

no test coverage detected