Skip to content

Commit

Permalink
check for length before trying to remove it
Browse files Browse the repository at this point in the history
  • Loading branch information
winglian committed Jan 23, 2024
1 parent fb7f9b9 commit 6ec7368
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/axolotl/core/trainer_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ def _get_eval_sampler(
def get_train_dataloader(self) -> DataLoader:
if self.args.sample_packing and not self.args.pretraining:
train_dataset = self.train_dataset
train_dataset = train_dataset.remove_columns(["length"])
if "length" in train_dataset.features.keys():
train_dataset = train_dataset.remove_columns(["length"])
data_collator = self.data_collator
dataloader_params = {
"batch_size": self._train_batch_size,
Expand Down

0 comments on commit 6ec7368

Please sign in to comment.