From 7134fb02bbdc9421f6c314ae176d5786a8cd768d Mon Sep 17 00:00:00 2001 From: hiyouga <467089858@qq.com> Date: Tue, 21 May 2024 20:03:09 +0800 Subject: [PATCH] fix paligemma sft --- src/llamafactory/data/preprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llamafactory/data/preprocess.py b/src/llamafactory/data/preprocess.py index 4bc5ad3c..7bf9d4bc 100644 --- a/src/llamafactory/data/preprocess.py +++ b/src/llamafactory/data/preprocess.py @@ -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(