Skip to content

Commit

Permalink
ema: fix saving of inference-compatible weights to reference the corr…
Browse files Browse the repository at this point in the history
…ect parameters instead of saving a 2nd copy of the main model
  • Loading branch information
bghira committed Nov 23, 2024
1 parent 4cb5e03 commit dcf0fc6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helpers/training/save_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def _save_lora(self, models, weights, output_dir):
logger.info("Saving EMA model to disk.")
trainable_parameters = [
p
for p in self.ema_model.parameters()
for p in self._primary_model().parameters()
if p.requires_grad
]
self.ema_model.store(trainable_parameters)
Expand Down

0 comments on commit dcf0fc6

Please sign in to comment.