Skip to content

Commit abe44c0

Browse files
committed
fix the idx issue for labels
1 parent ee204cc commit abe44c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

recipes/quickstart/finetuning/datasets/vqa_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def tokenize_dialog(dialog, images, processor):
3838
# found prompt header, indicating that this seq should be masked
3939
labels[last_idx:idx+1] = [-100] * (idx-last_idx+1)
4040
else:
41-
last_idx = idx
41+
last_idx = idx+1
4242
# Lastly mask all the assistant header prompt <|start_header_id|>assistant<|end_header_id|>, which has been tokenized to [128006, 78191, 128007]
4343
assistant_header_seq = [128006, 78191, 128007]
4444
labels = replace_target(assistant_header_seq,labels)

0 commit comments

Comments
 (0)