Skip to content

Commit 082158b

Browse files
committed
Removes duplicated args.
1 parent 00a394e commit 082158b

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

examples/controlnet/train_controlnet_flax.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,6 @@ def parse_args():
221221
default=None,
222222
help="Revision of controlnet model identifier from huggingface.co/models.",
223223
)
224-
parser.add_argument(
225-
"--controlnet_from_pt",
226-
action="store_true",
227-
help="Load the controlnet model from a PyTorch checkpoint.",
228-
)
229224
parser.add_argument(
230225
"--profile_steps",
231226
type=int,
@@ -248,12 +243,6 @@ def parse_args():
248243
default=None,
249244
help="Enables compilation cache.",
250245
)
251-
parser.add_argument(
252-
"--controlnet_revision",
253-
type=str,
254-
default=None,
255-
help="Revision of controlnet model identifier from huggingface.co/models.",
256-
)
257246
parser.add_argument(
258247
"--controlnet_from_pt",
259248
action="store_true",
@@ -1058,16 +1047,18 @@ def l2(xs):
10581047
)
10591048
# train
10601049
for batch in train_dataloader:
1061-
if args.profile_steps and global_step == 0:
1062-
jax.profiler.start_trace(args.output_dir)
1063-
if args.profile_steps and args.profile_steps == global_step:
1064-
jax.profiler.stop_trace()
10651050

10661051
batch = shard(batch)
10671052
with jax.profiler.StepTraceAnnotation("train", step_num=global_step):
10681053
state, train_metric, train_rngs = p_train_step(
10691054
state, unet_params, text_encoder_params, vae_params, batch, train_rngs
10701055
)
1056+
if args.profile_steps and global_step == 0:
1057+
train_metric['loss'].block_until_ready()
1058+
jax.profiler.start_trace(args.output_dir)
1059+
if args.profile_steps and args.profile_steps == global_step:
1060+
train_metric['loss'].block_until_ready()
1061+
jax.profiler.stop_trace()
10711062
train_metrics.append(train_metric)
10721063

10731064
train_step_progress_bar.update(1)

0 commit comments

Comments
 (0)