From 800a47fb17190a0cc71bb18470ba345ed7953be3 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Sun, 5 Jan 2025 19:17:56 +0530 Subject: [PATCH] fix filename --- finetrainers/trainer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/finetrainers/trainer.py b/finetrainers/trainer.py index 8dfd6a98..6ac59aa8 100644 --- a/finetrainers/trainer.py +++ b/finetrainers/trainer.py @@ -980,6 +980,8 @@ def validate(self, step: int, final_validation: bool = False) -> None: extension = "png" if artifact_type == "image" else "mp4" filename = "validation-" if not final_validation else "final-" filename += f"{step}-{accelerator.process_index}-{prompt_filename}.{extension}" + if accelerator.is_main_process and extension == "mp4": + prompts_to_filenames[prompt] = filename filename = os.path.join(self.args.output_dir, filename) if artifact_type == "image": @@ -991,8 +993,6 @@ def validate(self, step: int, final_validation: bool = False) -> None: # TODO: this should be configurable here as well as in validation runs where we call the pipeline that has `fps`. export_to_video(artifact_value, filename, fps=15) artifact_value = wandb.Video(filename, caption=prompt) - if accelerator.is_main_process: - prompts_to_filenames[prompt] = filename all_processes_artifacts.append(artifact_value)