MCPcopy Create free account
hub / github.com/MotrixLab/FineMoGen / load_pretrained

Method load_pretrained

mogen/models/transformers/intergen.py:198–204  ·  view source on GitHub ↗
(self, ckpt_path)

Source from the content-addressed store, hash-verified

196 return text_emb
197
198 def load_pretrained(self, ckpt_path):
199 checkpoint = torch.load(ckpt_path, map_location="cpu")
200 state_dict = checkpoint["state_dict"]
201 for k in list(state_dict.keys()):
202 if "model" in k:
203 state_dict[k.replace("model.", "")] = state_dict.pop(k)
204 self.load_state_dict(state_dict, strict=True)

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected