MCPcopy
hub / github.com/huggingface/diffusers / from_pretrained

Method from_pretrained

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

Source from the content-addressed store, hash-verified

659
660 @classmethod
661 def from_pretrained(cls, path, model_cls, foreach=False) -> "EMAModel":
662 _, ema_kwargs = model_cls.from_config(path, return_unused_kwargs=True)
663 model = model_cls.from_pretrained(path)
664
665 ema_model = cls(model.parameters(), model_cls=model_cls, model_config=model.config, foreach=foreach)
666
667 ema_model.load_state_dict(ema_kwargs)
668 return ema_model
669
670 def save_pretrained(self, path):
671 if self.model_cls is None:

Callers 15

save_pipeline_cosmos_1_0Function · 0.45
save_pipeline_cosmos_2_0Function · 0.45
download_and_save_vaeFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
convertFunction · 0.45
convert_modelsFunction · 0.45

Calls 3

parametersMethod · 0.80
from_configMethod · 0.45
load_state_dictMethod · 0.45

Tested by

no test coverage detected