Update s1_train.py

This commit is contained in:
RVC-Boss 2024-06-29 22:54:05 +08:00 committed by GitHub
parent 1b4c01e860
commit a208698e77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -79,15 +79,17 @@ class my_model_ckpt(ModelCheckpoint):
to_save_od["config"] = self.config to_save_od["config"] = self.config
to_save_od["info"] = "GPT-e%s" % (trainer.current_epoch + 1) to_save_od["info"] = "GPT-e%s" % (trainer.current_epoch + 1)
# torch.save( # torch.save(
my_save( # print(os.environ)
to_save_od, if(os.environ.get("LOCAL_RANK","0")=="0"):
"%s/%s-e%s.ckpt" my_save(
% ( to_save_od,
self.half_weights_save_dir, "%s/%s-e%s.ckpt"
self.exp_name, % (
trainer.current_epoch + 1, self.half_weights_save_dir,
), self.exp_name,
) trainer.current_epoch + 1,
),
)
self._save_last_checkpoint(trainer, monitor_candidates) self._save_last_checkpoint(trainer, monitor_candidates)