Skip to content

Commit 5d6d1f8

Browse files
author
sanchit-gandhi
committed
clean-up: make style
1 parent 9f776a2 commit 5d6d1f8

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

scripts/convert_original_audioldm_to_diffusers.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@
2323
parser = argparse.ArgumentParser()
2424

2525
parser.add_argument(
26-
"--checkpoint_path", default=None, type=str, required=True, help="Path to the checkpoint to convert."
26+
"--checkpoint_path",
27+
default="/Users/sanchitgandhi/convert-audioldm/ldm_trimmed.ckpt",
28+
type=str,
29+
required=False, # TODO: revert to True
30+
help="Path to the checkpoint to convert.",
2731
)
32+
# !wget https://raw.githubusercontent.com/CompVis/stable-diffusion/main/configs/stable-diffusion/v1-inference.yaml
2833
parser.add_argument(
2934
"--original_config_file",
3035
default=None,
@@ -43,6 +48,12 @@
4348
type=str,
4449
help="Type of scheduler to use. Should be one of ['pndm', 'lms', 'ddim', 'euler', 'euler-ancestral', 'dpm']",
4550
)
51+
parser.add_argument(
52+
"--pipeline_type",
53+
default=None,
54+
type=str,
55+
help="The pipeline type. If `None` pipeline will be automatically inferred.",
56+
)
4657
parser.add_argument(
4758
"--image_size",
4859
default=None,
@@ -57,7 +68,7 @@
5768
)
5869
parser.add_argument(
5970
"--extract_ema",
60-
action="store_true",
71+
action="store_false", # TODO: revert to store_true
6172
help=(
6273
"Only relevant for checkpoints that have both EMA and non-EMA weights. Whether to extract the EMA weights"
6374
" or not. Defaults to `False`. Add `--extract_ema` to extract the EMA weights. EMA weights usually yield"
@@ -74,7 +85,13 @@
7485
action="store_true",
7586
help="Whether to store pipeline in safetensors format or not.",
7687
)
77-
parser.add_argument("--dump_path", default=None, type=str, required=True, help="Path to the output model.")
88+
parser.add_argument(
89+
"--dump_path",
90+
default="/Users/sanchitgandhi/convert-audioldm/diffusers_out_3",
91+
type=str,
92+
required=False, # TODO: revert to True
93+
help="Path to the output model.",
94+
)
7895
parser.add_argument("--device", type=str, help="Device to use (e.g. cpu, cuda:0, cuda:1, etc.)")
7996
args = parser.parse_args()
8097

0 commit comments

Comments
 (0)