Nanobit commited on
Commit
9923b72
1 Parent(s): 21cf09b

Fix: eval table conflict with eval_sample_packing (#769)

Browse files
src/axolotl/utils/config.py CHANGED
@@ -348,6 +348,15 @@ def validate_config(cfg):
348
  "eval_steps and evaluation_strategy are not supported with val_set_size == 0"
349
  )
350
 
 
 
 
 
 
 
 
 
 
351
  # TODO
352
  # MPT 7b
353
  # https://github.com/facebookresearch/bitsandbytes/issues/25
 
348
  "eval_steps and evaluation_strategy are not supported with val_set_size == 0"
349
  )
350
 
351
+ if (
352
+ cfg.sample_packing
353
+ and cfg.eval_table_size
354
+ and cfg.eval_sample_packing is not False
355
+ ):
356
+ raise ValueError(
357
+ "eval_table_size and eval_sample_packing are not supported together with sample_packing. Please set 'eval_sample_packing' to false."
358
+ )
359
+
360
  # TODO
361
  # MPT 7b
362
  # https://github.com/facebookresearch/bitsandbytes/issues/25
tests/test_validation.py CHANGED
@@ -565,3 +565,44 @@ class ValidationTest(unittest.TestCase):
565
  )
566
 
567
  validate_config(cfg)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
565
  )
566
 
567
  validate_config(cfg)
568
+
569
+ def test_eval_table_size_conflict_eval_packing(self):
570
+ cfg = DictDefault(
571
+ {
572
+ "sample_packing": True,
573
+ "eval_table_size": 100,
574
+ }
575
+ )
576
+
577
+ with pytest.raises(
578
+ ValueError, match=r".*Please set 'eval_sample_packing' to false.*"
579
+ ):
580
+ validate_config(cfg)
581
+
582
+ cfg = DictDefault(
583
+ {
584
+ "sample_packing": True,
585
+ "eval_sample_packing": False,
586
+ }
587
+ )
588
+
589
+ validate_config(cfg)
590
+
591
+ cfg = DictDefault(
592
+ {
593
+ "sample_packing": False,
594
+ "eval_table_size": 100,
595
+ }
596
+ )
597
+
598
+ validate_config(cfg)
599
+
600
+ cfg = DictDefault(
601
+ {
602
+ "sample_packing": True,
603
+ "eval_table_size": 100,
604
+ "eval_sample_packing": False,
605
+ }
606
+ )
607
+
608
+ validate_config(cfg)