Skip to content

Commit d72d732

Browse files
pcuencasliard
authored andcommitted
Dreambooth: use warnings instead of logger in parse_args() (huggingface#1688)
Use warnings instead of logger in parse_args() logger requires an `Accelerator`.
1 parent 42be68c commit d72d732

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/dreambooth/train_dreambooth.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import itertools
44
import math
55
import os
6+
import warnings
67
from pathlib import Path
78
from typing import Optional
89

@@ -255,10 +256,11 @@ def parse_args(input_args=None):
255256
if args.class_prompt is None:
256257
raise ValueError("You must specify prompt for class images.")
257258
else:
259+
# logger is not available yet
258260
if args.class_data_dir is not None:
259-
logger.warning("You need not use --class_data_dir without --with_prior_preservation.")
261+
warnings.warn("You need not use --class_data_dir without --with_prior_preservation.")
260262
if args.class_prompt is not None:
261-
logger.warning("You need not use --class_prompt without --with_prior_preservation.")
263+
warnings.warn("You need not use --class_prompt without --with_prior_preservation.")
262264

263265
return args
264266

0 commit comments

Comments
 (0)