pets_rank_2 / train.py
elvis92's picture
End of training
71ac1fa
from huggingface_hub import notebook_login
# This script assumes that the environment variables and other setup have been done
# as specified in the terminal commands.
# The training command from the notebook is converted into a Python command
# using the 'subprocess' module (for instance).
import subprocess
# Training command for the second model
subprocess.run(["accelerate", "launch", "--mixed_precision=fp16", "train_text_to_image_lora.py",
"--pretrained_model_name_or_path=runwayml/stable-diffusion-v1-5",
"--dataset_name=pcuenq/oxford-pets",
"--dataloader_num_workers=8",
"--resolution=512", "--center_crop", "--random_flip",
"--train_batch_size=1",
"--gradient_accumulation_steps=4",
"--max_train_steps=15000",
"--learning_rate=1e-04",
"--max_grad_norm=1",
"--lr_scheduler=cosine", "--lr_warmup_steps=0",
"--output_dir=/content/gdrive/MyDrive/cs182/testing_pets/",
"--push_to_hub",
"--hub_model_id=pets",
"--checkpointing_steps=500",
"--validation_prompt=Totoro",
"--seed=1337",
"--caption_column=label"])