Skip to content

Commit d1f5636

Browse files
arrufatJimmy
authored and
Jimmy
committed
Rename --only_save_embeds to --save_as_full_pipeline (huggingface#3206)
* Set --only_save_embeds to False by default Due to how the option is named, it makes more sense to behave like this. * Refactor only_save_embeds to save_as_full_pipeline
1 parent b7e8ee4 commit d1f5636

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

examples/textual_inversion/textual_inversion.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,9 @@ def parse_args():
176176
help="Save learned_embeds.bin every X updates steps.",
177177
)
178178
parser.add_argument(
179-
"--only_save_embeds",
179+
"--save_as_full_pipeline",
180180
action="store_true",
181-
default=True,
182-
help="Save only the embeddings for the new concept.",
181+
help="Save the complete stable diffusion pipeline.",
183182
)
184183
parser.add_argument(
185184
"--num_vectors",
@@ -900,11 +899,11 @@ def main():
900899
# Create the pipeline using the trained modules and save it.
901900
accelerator.wait_for_everyone()
902901
if accelerator.is_main_process:
903-
if args.push_to_hub and args.only_save_embeds:
902+
if args.push_to_hub and not args.save_as_full_pipeline:
904903
logger.warn("Enabling full model saving because --push_to_hub=True was specified.")
905904
save_full_model = True
906905
else:
907-
save_full_model = not args.only_save_embeds
906+
save_full_model = args.save_as_full_pipeline
908907
if save_full_model:
909908
pipeline = StableDiffusionPipeline.from_pretrained(
910909
args.pretrained_model_name_or_path,

0 commit comments

Comments
 (0)