Skip to content

Commit

Permalink
fix paligemma sft
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyouga committed May 21, 2024
1 parent 4d647dd commit 7134fb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/llamafactory/data/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def preprocess_supervised_dataset(
if processor is not None and hasattr(processor, "image_seq_length"): # paligemma case
image_token_id = tokenizer.convert_tokens_to_ids(IMAGE_TOKEN)
input_ids += [image_token_id] * getattr(processor, "image_seq_length")
labels += [image_token_id] * getattr(processor, "image_seq_length")
labels += [IGNORE_INDEX] * getattr(processor, "image_seq_length")

for turn_idx, (source_ids, target_ids) in enumerate(
template.encode_multiturn(
Expand Down

0 comments on commit 7134fb0

Please sign in to comment.