MCPcopy Create free account
hub / github.com/Eladlev/AutoPrompt / save_state

Method save_state

optimization_pipeline.py:196–207  ·  view source on GitHub ↗

Save the process state

(self)

Source from the content-addressed store, hash-verified

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 """

Callers 1

stepMethod · 0.95

Calls 1

save_datasetMethod · 0.80

Tested by

no test coverage detected