Skip to content

Commit

Permalink
Fix: eval table conflict with eval_sample_packing (#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
NanoCode012 authored Oct 22, 2023
1 parent 21cf09b commit 9923b72
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/axolotl/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
41 changes: 41 additions & 0 deletions tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,3 +565,44 @@ def test_no_conflict_eval_strategy(self):
)

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)

0 comments on commit 9923b72

Please sign in to comment.