MCPcopy Create free account
hub / github.com/AIRMEC/HECTOR / save_checkpoint

Method save_checkpoint

utils.py:157–161  ·  view source on GitHub ↗
(self, model, log_dir, epoch)

Source from the content-addressed store, hash-verified

155 #self.save_checkpoint(model, log_dir, epoch)
156
157 def save_checkpoint(self, model, log_dir, epoch):
158 filepath = os.path.join(log_dir, f"{epoch}_checkpoint.pt")
159 if self.saving_checkpoint and not os.path.exists(filepath):
160 print(f"Saving model")
161 torch.save(model.state_dict(), filepath)
162
163 def _update_loss_scores(self, loss_score, eval_loss, epoch):
164 self.eval_loss_min = eval_loss

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected