MCPcopy Create free account
hub / github.com/THUDM/AgentTuning / __init__

Method __init__

eval_heldout/hotpotQA/src/wrappers.py:208–215  ·  view source on GitHub ↗
(self, env, folder="trajs", file_id=None)

Source from the content-addressed store, hash-verified

206
207class LoggingWrapper(gym.Wrapper):
208 def __init__(self, env, folder="trajs", file_id=None):
209 super().__init__(env)
210 self.trajs = []
211 self.traj = {"observations": [], "actions": []}
212 self.folder = folder
213 self.file_id = np.random.randint(0, 10000000) if file_id is None else file_id
214 self.file_path = f"{self.folder}/{self.file_id}.json"
215 os.makedirs("trajs", exist_ok=True)
216
217 def __len__(self):
218 return len(self.env.data)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected