Find the latest samples_gsm8k*.jsonl under eval_dir.
(eval_dir: str)
| 235 | |
| 236 | |
| 237 | def find_samples(eval_dir: str) -> Path | None: |
| 238 | """Find the latest samples_gsm8k*.jsonl under eval_dir.""" |
| 239 | pattern = os.path.join(eval_dir, "**", "samples_gsm8k*.jsonl") |
| 240 | matches = sorted(glob(pattern, recursive=True)) |
| 241 | if not matches: |
| 242 | return None |
| 243 | return Path(matches[-1]) |
| 244 | |
| 245 | |
| 246 | def load_samples(path: Path) -> list[dict]: |