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