Skip to content

Commit

Permalink
fix save command not using the one on the trainer class, for saving o…
Browse files Browse the repository at this point in the history
…ptimizer state
  • Loading branch information
lucidrains committed Feb 15, 2023
1 parent 0247f2c commit c9b10bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions musiclm_pytorch/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,8 @@ def train_step(self):
# save model every so often

if self.is_main and not (steps % self.save_model_every):
state_dict = self.mulan.state_dict()
model_path = str(self.results_folder / f'mulan.{steps}.pt')
torch.save(state_dict, model_path)
self.save(model_path)

self.print(f'{steps}: saving model to {str(self.results_folder)}')

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name = 'musiclm-pytorch',
packages = find_packages(exclude=[]),
version = '0.0.24',
version = '0.0.25',
license='MIT',
description = 'MusicLM - AudioLM + Audio CLIP to text to music synthesis',
author = 'Phil Wang',
Expand Down

0 comments on commit c9b10bb

Please sign in to comment.