Save the process state
(self)
| 194 | self.dataset.add(samples_list, 0) |
| 195 | |
| 196 | def save_state(self): |
| 197 | """ |
| 198 | Save the process state |
| 199 | """ |
| 200 | if self.output_path is None: |
| 201 | return |
| 202 | logging.info('Save state') |
| 203 | self.dataset.save_dataset(self.output_path / 'dataset.csv') |
| 204 | state = {'history': self.eval.history, 'batch_id': self.batch_id, |
| 205 | 'prompt': self.cur_prompt, 'task_description': self.task_description, |
| 206 | 'patient': self.patient} |
| 207 | pickle.dump(state, open(self.output_path / 'history.pkl', 'wb')) |
| 208 | |
| 209 | def load_state(self, path: str): |
| 210 | """ |