MCPcopy Create free account
hub / github.com/tdrussell/diffusion-pipe / load_diffusion_model

Method load_diffusion_model

models/cosmos.py:166–173  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

164 )
165
166 def load_diffusion_model(self):
167 with accelerate.init_empty_weights():
168 self.model.model = self.model.build_model()
169 net_state_dict = load_state_dict(self.model_config['transformer_path'])
170 incompatible = self.model.model.load_state_dict(net_state_dict, strict=False, assign=True)
171 missing_keys = [k for k in incompatible.missing_keys if "_extra_state" not in k]
172 assert len(missing_keys) == 0
173 self.transformer = self.model.net
174
175 def model_specific_dataset_config_validation(self, dataset_config):
176 passes_validation = True

Callers

nothing calls this directly

Calls 2

load_state_dictFunction · 0.90
load_state_dictMethod · 0.45

Tested by

no test coverage detected