Skip to content

Commit

Permalink
Emphasize the order of loading models in diffusion pipelines (#742)
Browse files Browse the repository at this point in the history
quick fix
  • Loading branch information
JingyaHuang authored Nov 26, 2024
1 parent d78c7c7 commit c490b5c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions optimum/neuron/modeling_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,11 @@ def load_model(
Whether to move manually the traced model to NeuronCore. It's only needed when `inline_weights_to_neff=False`, otherwise it is loaded automatically to a Neuron device.
"""
submodels = {
"text_encoder": text_encoder_path,
"text_encoder_2": text_encoder_2_path,
# Load the UNet/Diffusion transformer first to avoid CPU OOM
"unet": unet_path,
"transformer": transformer_path,
"text_encoder": text_encoder_path,
"text_encoder_2": text_encoder_2_path,
"vae_encoder": vae_encoder_path,
"vae_decoder": vae_decoder_path,
"controlnet": controlnet_paths,
Expand Down

0 comments on commit c490b5c

Please sign in to comment.