Skip to content

Commit

Permalink
fix filename
Browse files Browse the repository at this point in the history
  • Loading branch information
sayakpaul committed Jan 5, 2025
1 parent 9f1c5d9 commit 800a47f
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 @@ -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":
Expand All @@ -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)

Expand Down

0 comments on commit 800a47f

Please sign in to comment.