From 57302431791f2f9a839cac92ea551386ee61efb0 Mon Sep 17 00:00:00 2001 From: hoshi-hiyouga Date: Fri, 30 Aug 2024 02:05:26 +0800 Subject: [PATCH] fix bug Former-commit-id: a8f22d8895c07ce37e8cb34b7014f3e9bcdbf6a3 --- src/llamafactory/data/processors/supervised.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llamafactory/data/processors/supervised.py b/src/llamafactory/data/processors/supervised.py index 6b3a4562..f324036e 100644 --- a/src/llamafactory/data/processors/supervised.py +++ b/src/llamafactory/data/processors/supervised.py @@ -50,7 +50,7 @@ def _encode_supervised_example( train_on_prompt: bool, mask_history: bool, ) -> Tuple[List[int], List[int]]: - if "image_grid_thw" in processor.model_input_names: # qwen2_vl models + if processor is not None and "image_grid_thw" in processor.model_input_names: # qwen2_vl models image_processor = getattr(processor, "image_processor") merge_length = image_processor.merge_size**2 if len(images) > 0: