|
10 | 10 | import datasets |
11 | 11 | import hydra |
12 | 12 | import podman |
| 13 | +import tapeagents.config |
13 | 14 | from omegaconf import DictConfig |
14 | 15 | from pdf2image import convert_from_path |
15 | 16 | from pydantic import ConfigDict, Field |
@@ -79,16 +80,16 @@ def __init__( |
79 | 80 | self.task_seed = task_seed |
80 | 81 | self.env_config = env_config |
81 | 82 |
|
82 | | - def make_env(self, exp_dir: str | Path, action_mapping=None) -> GaiaGym: |
83 | | - exp_dir = str(exp_dir) |
84 | | - logger.info(f"Init gaia env with directory {exp_dir}") |
85 | | - os.environ["TAPEAGENTS_SQLITE_DB"] = os.path.join(exp_dir, "tapedata.sqlite") |
86 | | - init_code_sandbox(exp_dir) |
| 83 | + def make_env(self, exp_dir: Path, action_mapping=None) -> GaiaGym: |
| 84 | + tapeagents.config.DB_DEFAULT_FILENAME = str(exp_dir.parent / "tapedata.sqlite") |
| 85 | + exp_dir_str = str(exp_dir) |
| 86 | + logger.info(f"Init gaia env with directory {exp_dir_str}") |
| 87 | + init_code_sandbox(exp_dir_str) |
87 | 88 | for i in range(len(self.env_config.tools)): |
88 | 89 | if hasattr(self.env_config.tools[i], "exp_path"): |
89 | | - self.env_config.tools[i].exp_path = exp_dir |
| 90 | + self.env_config.tools[i].exp_path = exp_dir_str |
90 | 91 | tools = hydra.utils.instantiate(self.env_config.tools) |
91 | | - env = GaiaGym(tools=tools, task=self.task, exp_dir=exp_dir) |
| 92 | + env = GaiaGym(tools=tools, task=self.task, exp_dir=exp_dir_str) |
92 | 93 | return env |
93 | 94 |
|
94 | 95 |
|
|
0 commit comments