ch + 1) % config.save_image_epochs == 0 or epoch == config.num_epochs - 1:
...                 evaluate(config, epoch, pipeline)

...             if (epoch + 1) % config.save_model_epochs == 0 or epoch == config.num_epochs - 1:
...                 if config.push_to_hub:
...                     repo.push_to_hub(commit_message=f"Epoch {epoch}", blocking=True)
...                 else:
...                     pipeline.save_pretrained(config.output