make pad_to_sequence_len default to the same value as sample_packing (#2941) [skip ci]

* make pad_to_sequence_len default to the same value as sample_packing

* remove duplicate validation

* fix test

* update description meta

Co-authored-by: NanoCode012 <nano@axolotl.ai>

---------

Co-authored-by: NanoCode012 <nano@axolotl.ai>
This commit is contained in:
Wing Lian
2025-07-21 11:40:56 -04:00
committed by GitHub
parent db5f6f4693
commit af8d257aa2
90 changed files with 109 additions and 90 deletions

View File

@@ -0,0 +1,21 @@
"""Tests for default values for configurations"""
from axolotl.utils.config import validate_config
from axolotl.utils.dict import DictDefault
class TestDefaultConfigValues:
"""Tests for default values for configurations"""
def test_pad_to_sequence_len(self, min_base_cfg):
"""Tests that sample packing automatically sets pad_to_sequence_len to True"""
cfg = (
DictDefault(
sample_packing=True,
)
| min_base_cfg
)
cfg = validate_config(cfg)
assert cfg.pad_to_sequence_len is True