Skip to content

Commit

Permalink
Store model on CPU during convert_pixart_to_diffusers.py process (Pix…
Browse files Browse the repository at this point in the history
…Art-alpha#66)

Loads the torch model into CPU memory for systems with low VRAM available.
  • Loading branch information
congruency authored Apr 26, 2024
1 parent 716d75d commit 0c8d020
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/convert_pixart_to_diffusers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

def main(args):
interpolation_scale = interpolation_scale_alpha if args.version == "alpha" else interpolation_scale_sigma
all_state_dict = torch.load(args.orig_ckpt_path)
all_state_dict = torch.load(args.orig_ckpt_path, map_location=torch.device('cpu'))
state_dict = all_state_dict.pop("state_dict")
converted_state_dict = {}

Expand Down

0 comments on commit 0c8d020

Please sign in to comment.