Skip to content

Commit

Permalink
Merge pull request #620 from bghira/bug/hash-filenames-v1
Browse files Browse the repository at this point in the history
bugfix: correctly set hash_filenames to true or false for an initial dataset creation
  • Loading branch information
bghira authored Aug 4, 2024
2 parents 82be160 + d7e8bed commit f4fe597
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions helpers/data_backend/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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}"
)
Expand Down Expand Up @@ -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.")
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit f4fe597

Please sign in to comment.