MCPcopy Create free account
hub / github.com/OpenLMLab/MOSS-RLHF / load_data

Method load_data

ppo/ppo_datahelper.py:130–137  ·  view source on GitHub ↗
(self, file_path: str)

Source from the content-addressed store, hash-verified

128 self.batch_size = opt.rollout_batch_size # batch size for sampling from env
129
130 def load_data(self, file_path: str):
131 with open(file_path, 'r') as f:
132 data: List[List[str]] = json.load(f)
133
134 output: List[List[str]] = [sample for sample in data if all(sample)]
135 del data
136
137 return output
138
139 def format(self, sample: List[str]) -> Dict[str, Any]:
140 context = sample

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected