From d7e8bed73568fd11fcb40f2def108fc8a8334090 Mon Sep 17 00:00:00 2001 From: bghira Date: Sat, 3 Aug 2024 23:48:20 -0600 Subject: [PATCH] bugfix: correctly set hash_filenames to true or false for an initial dataset creation --- helpers/data_backend/factory.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/helpers/data_backend/factory.py b/helpers/data_backend/factory.py index 3fda5f7b..7e794f75 100644 --- a/helpers/data_backend/factory.py +++ b/helpers/data_backend/factory.py @@ -534,7 +534,6 @@ def configure_multi_databackend( info_log(f"Configuring data backend: {backend['id']}") # Retrieve some config file overrides for commandline arguments, eg. cropping init_backend = init_backend_config(backend, args, accelerator) - info_log(f"Configured backend: {init_backend}") StateTracker.set_data_backend_config( data_backend_id=init_backend["id"], config=init_backend["config"], @@ -730,9 +729,7 @@ def configure_multi_databackend( if current_config_version is None: # backwards compatibility for non-versioned config files, so that we do not enable life-changing options. current_config_version = 1 - init_backend["config"]["hash_filenames"] = False - if "hash_filenames" not in prev_config and current_config_version < 2: - init_backend["config"]["hash_filenames"] = False + logger.debug( f"Found existing config (version={current_config_version}): {prev_config}" ) @@ -886,6 +883,9 @@ def configure_multi_databackend( hash_filenames = init_backend.get("config", {}).get( "hash_filenames", default_hash_option ) + init_backend["config"]["hash_filenames"] = hash_filenames + StateTracker.set_data_backend_config(init_backend["id"], init_backend["config"]) + logger.debug(f"Hashing filenames: {hash_filenames}") if "deepfloyd" not in StateTracker.get_args().model_type: info_log(f"(id={init_backend['id']}) Creating VAE latent cache.") @@ -978,6 +978,8 @@ def configure_multi_databackend( ) accelerator.wait_for_everyone() + info_log(f"Configured backend: {init_backend}") + StateTracker.register_data_backend(init_backend) init_backend["metadata_backend"].save_cache()