fix bug in packed sft dataset

This commit is contained in:
hiyouga 2023-09-28 01:16:46 +08:00
parent 5d4118b096
commit de19614306
1 changed files with 1 additions and 1 deletions

View File

@ -116,7 +116,7 @@ def preprocess_dataset(
# split by chunks of cutoff_len
for i in range(0, total_length, block_size):
model_inputs["input_ids"].append(input_ids[i: i + block_size])
model_inputs["attention_mask"].append([1] * len(block_size))
model_inputs["attention_mask"].append([1] * block_size)
model_inputs["labels"].append(labels[i: i + block_size])
return model_inputs