MCPcopy Index your code
hub / github.com/YesianRohn/TextSSR / from_pretrained

Method from_pretrained

diffusers/src/diffusers/training_utils.py:366–373  ·  view source on GitHub ↗
(cls, path, model_cls, foreach=False)

Source from the content-addressed store, hash-verified

364
365 @classmethod
366 def from_pretrained(cls, path, model_cls, foreach=False) -> "EMAModel":
367 _, ema_kwargs = model_cls.load_config(path, return_unused_kwargs=True)
368 model = model_cls.from_pretrained(path)
369
370 ema_model = cls(model.parameters(), model_cls=model_cls, model_config=model.config, foreach=foreach)
371
372 ema_model.load_state_dict(ema_kwargs)
373 return ema_model
374
375 def save_pretrained(self, path):
376 if self.model_cls is None:

Callers 15

infer.pyFile · 0.45
mainFunction · 0.45
mainFunction · 0.45
load_model_hookFunction · 0.45
convertFunction · 0.45
convert_modelsFunction · 0.45
mainFunction · 0.45

Calls 2

load_configMethod · 0.80
load_state_dictMethod · 0.80

Tested by 15

get_modelsMethod · 0.36
test_serializationMethod · 0.36
get_modelsMethod · 0.36
test_serializationMethod · 0.36
test_load_pndmMethod · 0.36
test_load_dpmsolverMethod · 0.36