utils_2.py 478 B

1234567891011
  1. def save_task_checkpoint(file_path, task_num):
  2. """
  3. Saves the current state of the model for a given task by copying existing checkpoint created by the
  4. save_checkpoint function.
  5. Parameters:
  6. file_path (str): Path to save the file,
  7. task_num (int): Number of task increment.
  8. """
  9. save_path = os.path.join(file_path, 'checkpoint_task_' + str(task_num) + '.pth.tar')
  10. shutil.copyfile(os.path.join(file_path, 'checkpoint.pth.tar'), save_path)