MCPcopy Index your code
hub / github.com/huggingface/diffusers / download_model

Function download_model

scripts/convert_dit_to_diffusers.py:13–23  ·  view source on GitHub ↗

Downloads a pre-trained DiT model from the web.

(model_name)

Source from the content-addressed store, hash-verified

11
12
13def download_model(model_name):
14 """
15 Downloads a pre-trained DiT model from the web.
16 """
17 local_path = f"pretrained_models/{model_name}"
18 if not os.path.isfile(local_path):
19 os.makedirs("pretrained_models", exist_ok=True)
20 web_path = f"https://dl.fbaipublicfiles.com/DiT/models/{model_name}"
21 download_url(web_path, "pretrained_models")
22 model = torch.load(local_path, map_location=lambda storage, loc: storage)
23 return model
24
25
26def main(args):

Callers 1

mainFunction · 0.85

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…