MCPcopy Create free account
hub / github.com/agentscope-ai/Trinity-RFT / save_trainer

Method save_trainer

trinity/manager/state_manager.py:102–115  ·  view source on GitHub ↗
(
        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):

Callers 1

save_checkpointMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected