Implement huggingface upload for all scripts

This commit is contained in:
ddPn08
2023-04-01 23:16:02 +09:00
parent b5c7937f8d
commit 3cc4939dd3
3 changed files with 8 additions and 0 deletions

View File

@@ -2830,6 +2830,8 @@ def save_sd_model_on_epoch_end(
model_util.save_stable_diffusion_checkpoint(
args.v2, ckpt_file, text_encoder, unet, src_path, epoch_no, global_step, save_dtype, vae
)
if args.huggingface_repo_id is not None:
huggingface_util.upload(ckpt_file, args, "/" + ckpt_name)
def remove_sd(old_epoch_no):
_, old_ckpt_name = get_epoch_ckpt_name(args, use_safetensors, old_epoch_no)