Skip to content

Commit

Permalink
disable main process check for deepspeed kohya-ss#1247
Browse files Browse the repository at this point in the history
  • Loading branch information
kohya-ss authored and A4P7J1N7M05OT committed May 12, 2024
1 parent 95f4c52 commit 2be64b3
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 2be64b3

Please sign in to comment.