MCPcopy Create free account
hub / github.com/OpenBMB/AgentCPM-GUI / dump_traj

Function dump_traj

eval/eval_data/process_odyssey.py:120–134  ·  view source on GitHub ↗
(traj, out_root: Path, idx: int)

Source from the content-addressed store, hash-verified

118
119# save data
120def dump_traj(traj, out_root: Path, idx: int):
121 if not traj:
122 return
123
124 subfolder_name = f"traj_{idx:05d}"
125 subfolder_path = out_root / subfolder_name
126 subfolder_path.mkdir(parents=True, exist_ok=True)
127
128 out_filename = f"{subfolder_name}.json"
129 out_file = subfolder_path / out_filename
130
131 with out_file.open("w", encoding="utf-8") as fw:
132 json.dump(traj, fw, ensure_ascii=False, indent=2)
133
134 print(f"Save {subfolder_name}/{out_filename} (steps={len(traj)})")
135
136
137records = data_eval

Callers 1

process_odyssey.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected