Skip to content

Commit

Permalink
disable main process check for deepspeed #1247
Browse files Browse the repository at this point in the history
  • Loading branch information
kohya-ss committed Apr 21, 2024
1 parent 71e2c91 commit 52652cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion train_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,8 @@ def train(self, args):
# before resuming make hook for saving/loading to save/load the network weights only
def save_model_hook(models, weights, output_dir):
# pop weights of other models than network to save only network weights
if accelerator.is_main_process:
# only main process or deepspeed https://github.com/huggingface/diffusers/issues/2606
if accelerator.is_main_process or args.deepspeed:
remove_indices = []
for i, model in enumerate(models):
if not isinstance(model, type(accelerator.unwrap_model(network))):
Expand Down

0 comments on commit 52652cb

Please sign in to comment.