mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-22 21:52:51 +08:00
fix paligemma sft
Former-commit-id: 7134fb02bbdc9421f6c314ae176d5786a8cd768d
This commit is contained in:
parent
a8480baa11
commit
4ddc1c9c16
@ -89,7 +89,7 @@ def preprocess_supervised_dataset(
|
|||||||
if processor is not None and hasattr(processor, "image_seq_length"): # paligemma case
|
if processor is not None and hasattr(processor, "image_seq_length"): # paligemma case
|
||||||
image_token_id = tokenizer.convert_tokens_to_ids(IMAGE_TOKEN)
|
image_token_id = tokenizer.convert_tokens_to_ids(IMAGE_TOKEN)
|
||||||
input_ids += [image_token_id] * getattr(processor, "image_seq_length")
|
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(
|
for turn_idx, (source_ids, target_ids) in enumerate(
|
||||||
template.encode_multiturn(
|
template.encode_multiturn(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user