Skip to content

Commit

Permalink
fix validation bug (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-r-r-o-w authored Dec 25, 2024
1 parent cf9be17 commit 2a594ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions finetrainers/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,10 +813,6 @@ def validate(self, step: int) -> None:
generator=self.state.generator,
)

# Remove all hooks that might have been added during pipeline initialization to the models
pipeline.remove_all_hooks()
del pipeline

prompt_filename = string_to_filename(prompt)[:25]
artifacts = {
"image": {"type": "image", "value": image},
Expand Down Expand Up @@ -857,6 +853,10 @@ def validate(self, step: int) -> None:
if tracker.name == "wandb":
tracker.log({"validation": all_artifacts}, step=step)

# Remove all hooks that might have been added during pipeline initialization to the models
pipeline.remove_all_hooks()
del pipeline

accelerator.wait_for_everyone()

free_memory()
Expand Down

0 comments on commit 2a594ea

Please sign in to comment.