Method
save_trainer
(
self,
current_step: int,
sample_strategy_state: dict,
)
Source from the content-addressed store, hash-verified
| 100 | return None |
| 101 | |
| 102 | def save_trainer( |
| 103 | self, |
| 104 | current_step: int, |
| 105 | sample_strategy_state: dict, |
| 106 | ) -> None: |
| 107 | with open(self.trainer_state_path, "w", encoding="utf-8") as f: |
| 108 | json.dump( |
| 109 | { |
| 110 | "latest_iteration": current_step, |
| 111 | "sample_strategy_state": sample_strategy_state, |
| 112 | }, |
| 113 | f, |
| 114 | indent=2, |
| 115 | ) |
| 116 | |
| 117 | def load_trainer(self) -> dict: |
| 118 | if os.path.exists(self.trainer_state_path): |
Tested by
no test coverage detected