From 2bebe2928514c9610c7ffb2ef9a69838aed21e86 Mon Sep 17 00:00:00 2001 From: bghira Date: Sat, 16 Nov 2024 14:15:38 -0600 Subject: [PATCH 1/2] error out when cache dir path is not found --- helpers/data_backend/factory.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/helpers/data_backend/factory.py b/helpers/data_backend/factory.py index 3c1e2775..37b3c8fe 100644 --- a/helpers/data_backend/factory.py +++ b/helpers/data_backend/factory.py @@ -1053,6 +1053,11 @@ def configure_multi_databackend(args: dict, accelerator, text_encoders, tokenize raise ValueError( f"VAE image embed cache directory {backend.get('cache_dir_vae')} is the same as the text embed cache directory. This is not allowed, the trainer will get confused." ) + + if vae_cache_dir is None or vae_cache_dir == "": + raise ValueError( + f"VAE image embed cache directory {backend.get('cache_dir_vae')} is not set. This is required for the VAE image embed cache." + ) init_backend["vaecache"] = VAECache( id=init_backend["id"], vae=StateTracker.get_vae(), From c6ce73879a390d318444a716e1887e5ca0fe96a7 Mon Sep 17 00:00:00 2001 From: bghira Date: Sat, 16 Nov 2024 14:17:00 -0600 Subject: [PATCH 2/2] reduce error to local backends only --- helpers/data_backend/factory.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helpers/data_backend/factory.py b/helpers/data_backend/factory.py index 37b3c8fe..1ba4d9a3 100644 --- a/helpers/data_backend/factory.py +++ b/helpers/data_backend/factory.py @@ -1054,7 +1054,9 @@ def configure_multi_databackend(args: dict, accelerator, text_encoders, tokenize f"VAE image embed cache directory {backend.get('cache_dir_vae')} is the same as the text embed cache directory. This is not allowed, the trainer will get confused." ) - if vae_cache_dir is None or vae_cache_dir == "": + if backend["type"] == "local" and ( + vae_cache_dir is None or vae_cache_dir == "" + ): raise ValueError( f"VAE image embed cache directory {backend.get('cache_dir_vae')} is not set. This is required for the VAE image embed cache." )