Add ipo as an rl type that shares DPODataset config (#3128)

* Add `ipo` as an `rl` type that shares DPODataset config

* chore: lint

---------

Co-authored-by: Wing Lian <wing@axolotl.ai>
This commit is contained in:
Seungduk Kim
2025-09-07 23:49:10 +09:00
committed by GitHub
parent bf00f29f3a
commit 8fd9221f13

View File

@@ -273,7 +273,9 @@ def validate_config(
# Convert datasets to proper format if needed
if cfg.get("datasets"):
for idx, ds_cfg in enumerate(cfg["datasets"]):
if cfg.get("rl") in ["dpo", "simpo"] and not isinstance(ds_cfg, DPODataset):
if cfg.get("rl") in ["dpo", "ipo", "simpo"] and not isinstance(
ds_cfg, DPODataset
):
cfg["datasets"][idx] = DPODataset(**ds_cfg)
elif cfg.get("rl") == "kto" and not isinstance(ds_cfg, KTODataset):
cfg["datasets"][idx] = KTODataset(**dict(ds_cfg))