Skip to content

Commit

Permalink
[Bug] fix cfg check (#729)
Browse files Browse the repository at this point in the history
fix cfg check
  • Loading branch information
HIT-cwh authored May 29, 2024
1 parent 0d148dc commit 4910476
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions xtuner/tools/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,6 @@ def check_cfg(cfg):
f'If utilizing varlen attention, the batch size should be'
f' set to 1, but got {cfg.train_dataloader.batch_size}')

if getattr(cfg, 'use_varlen_attn', False) and (not getattr(
cfg.train_dataloader.dataset, 'pack_to_max_length', True)):
raise AssertionError(
'When using varlen attention, `pack_to_max_length`'
'should be set to True, but got use_varlen_attn = True and '
'pack_to_max_length = False.')

if getattr(cfg, 'use_varlen_attn', False):
sequence_parallel = getattr(cfg, 'sequence_parallel', 1)
max_length = getattr(cfg.train_dataloader.dataset, 'max_length', None)
Expand Down

0 comments on commit 4910476

Please sign in to comment.