From cdda94f412413eb1fe86b17dbb2b1e8d108aa59e Mon Sep 17 00:00:00 2001 From: bssrdf Date: Mon, 13 May 2024 22:49:53 -0400 Subject: [PATCH] fix VAE loading issue in train_dreambooth (#7632) * fixed vae loading issue #7619 * rerun make style && make quality * bring back model_has_vae and add change \ to / in config_file_name on windows os to make match work * add missing import platform * bring back import model_info * make config_file_name OS independent * switch to using Path.as_posix() to resolve OS dependence * improve style --------- Co-authored-by: Sayak Paul Co-authored-by: bssrdf Co-authored-by: Dhruv Nair --- examples/dreambooth/train_dreambooth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/dreambooth/train_dreambooth.py b/examples/dreambooth/train_dreambooth.py index a18c443e7d..103e3b5b10 100644 --- a/examples/dreambooth/train_dreambooth.py +++ b/examples/dreambooth/train_dreambooth.py @@ -759,7 +759,7 @@ class PromptDataset(Dataset): def model_has_vae(args): - config_file_name = os.path.join("vae", AutoencoderKL.config_name) + config_file_name = Path("vae", AutoencoderKL.config_name).as_posix() if os.path.isdir(args.pretrained_model_name_or_path): config_file_name = os.path.join(args.pretrained_model_name_or_path, config_file_name) return os.path.isfile(config_file_name)