Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
a-r-r-o-w committed Jan 5, 2025
1 parent cee97b8 commit 45cebd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions finetrainers/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -974,15 +974,15 @@ def validate(self, step: int, final_validation: bool = False) -> None:
main_process_only=False,
)

for key, value in list(artifacts.items()):
for index, (key, value) in enumerate(list(artifacts.items())):
artifact_type = value["type"]
artifact_value = value["value"]
if artifact_type not in ["image", "video"] or artifact_value is None:
continue

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}"
filename += f"{step}-{accelerator.process_index}-{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)
Expand Down

0 comments on commit 45cebd7

Please sign in to comment.