diff --git a/src/axolotl/utils/config.py b/src/axolotl/utils/config.py index 82e2a5117..9fa83b9af 100644 --- a/src/axolotl/utils/config.py +++ b/src/axolotl/utils/config.py @@ -348,6 +348,15 @@ def validate_config(cfg): "eval_steps and evaluation_strategy are not supported with val_set_size == 0" ) + if ( + cfg.sample_packing + and cfg.eval_table_size + and cfg.eval_sample_packing is not False + ): + raise ValueError( + "eval_table_size and eval_sample_packing are not supported together with sample_packing. Please set 'eval_sample_packing' to false." + ) + # TODO # MPT 7b # https://github.com/facebookresearch/bitsandbytes/issues/25 diff --git a/tests/test_validation.py b/tests/test_validation.py index 35d90a2cb..98c91da49 100644 --- a/tests/test_validation.py +++ b/tests/test_validation.py @@ -565,3 +565,44 @@ class ValidationTest(unittest.TestCase): ) validate_config(cfg) + + def test_eval_table_size_conflict_eval_packing(self): + cfg = DictDefault( + { + "sample_packing": True, + "eval_table_size": 100, + } + ) + + with pytest.raises( + ValueError, match=r".*Please set 'eval_sample_packing' to false.*" + ): + validate_config(cfg) + + cfg = DictDefault( + { + "sample_packing": True, + "eval_sample_packing": False, + } + ) + + validate_config(cfg) + + cfg = DictDefault( + { + "sample_packing": False, + "eval_table_size": 100, + } + ) + + validate_config(cfg) + + cfg = DictDefault( + { + "sample_packing": True, + "eval_table_size": 100, + "eval_sample_packing": False, + } + ) + + validate_config(cfg)