Unverified Commit 7e92c5bc authored by Yuta Hayashibe's avatar Yuta Hayashibe Committed by GitHub
Browse files

Fix typos (#718)



* Fix typos

* Update examples/dreambooth/train_dreambooth.py
Co-authored-by: default avatarPedro Cuenca <pedro@huggingface.co>
Co-authored-by: default avatarPedro Cuenca <pedro@huggingface.co>
parent 4d1cce2f
...@@ -120,7 +120,7 @@ print(pipe.unet.conv_out.state_dict()["weight"].stride()) # (2880, 9, 3, 1) ...@@ -120,7 +120,7 @@ print(pipe.unet.conv_out.state_dict()["weight"].stride()) # (2880, 9, 3, 1)
pipe.unet.to(memory_format=torch.channels_last) # in-place operation pipe.unet.to(memory_format=torch.channels_last) # in-place operation
print( print(
pipe.unet.conv_out.state_dict()["weight"].stride() pipe.unet.conv_out.state_dict()["weight"].stride()
) # (2880, 1, 960, 320) haveing a stride of 1 for the 2nd dimension proves that it works ) # (2880, 1, 960, 320) having a stride of 1 for the 2nd dimension proves that it works
``` ```
## Tracing ## Tracing
......
...@@ -62,7 +62,7 @@ accelerate launch train_dreambooth.py \ ...@@ -62,7 +62,7 @@ accelerate launch train_dreambooth.py \
### Training with prior-preservation loss ### Training with prior-preservation loss
Prior-preservation is used to avoid overfitting and language-drift. Refer to the paper to learn more about it. For prior-preservation we first generate images using the model with a class prompt and then use those during training along with our data. Prior-preservation is used to avoid overfitting and language-drift. Refer to the paper to learn more about it. For prior-preservation we first generate images using the model with a class prompt and then use those during training along with our data.
According to the paper, it's recommened to generate `num_epochs * num_samples` images for prior-preservation. 200-300 works well for most cases. According to the paper, it's recommended to generate `num_epochs * num_samples` images for prior-preservation. 200-300 works well for most cases.
```bash ```bash
export MODEL_NAME="CompVis/stable-diffusion-v1-4" export MODEL_NAME="CompVis/stable-diffusion-v1-4"
......
...@@ -58,19 +58,19 @@ def parse_args(): ...@@ -58,19 +58,19 @@ def parse_args():
"--instance_prompt", "--instance_prompt",
type=str, type=str,
default=None, default=None,
help="The prompt with identifier specifing the instance", help="The prompt with identifier specifying the instance",
) )
parser.add_argument( parser.add_argument(
"--class_prompt", "--class_prompt",
type=str, type=str,
default=None, default=None,
help="The prompt to specify images in the same class as provided intance images.", help="The prompt to specify images in the same class as provided instance images.",
) )
parser.add_argument( parser.add_argument(
"--with_prior_preservation", "--with_prior_preservation",
default=False, default=False,
action="store_true", action="store_true",
help="Flag to add prior perservation loss.", help="Flag to add prior preservation loss.",
) )
parser.add_argument("--prior_loss_weight", type=float, default=1.0, help="The weight of prior preservation loss.") parser.add_argument("--prior_loss_weight", type=float, default=1.0, help="The weight of prior preservation loss.")
parser.add_argument( parser.add_argument(
...@@ -214,7 +214,7 @@ def parse_args(): ...@@ -214,7 +214,7 @@ def parse_args():
class DreamBoothDataset(Dataset): class DreamBoothDataset(Dataset):
""" """
A dataset to prepare the instance and class images with the promots for fine-tuning the model. A dataset to prepare the instance and class images with the prompts for fine-tuning the model.
It pre-processes the images and the tokenizes prompts. It pre-processes the images and the tokenizes prompts.
""" """
......
...@@ -40,7 +40,7 @@ class SubprocessCallException(Exception): ...@@ -40,7 +40,7 @@ class SubprocessCallException(Exception):
def run_command(command: List[str], return_stdout=False): def run_command(command: List[str], return_stdout=False):
""" """
Runs `command` with `subprocess.check_output` and will potentially return the `stdout`. Will also properly capture Runs `command` with `subprocess.check_output` and will potentially return the `stdout`. Will also properly capture
if an error occured while running `command` if an error occurred while running `command`
""" """
try: try:
output = subprocess.check_output(command, stderr=subprocess.STDOUT) output = subprocess.check_output(command, stderr=subprocess.STDOUT)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment