From 428599f3e571cdc0e4b862aa12157559a5c9cd97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=8C=E5=97=94?= Date: Mon, 24 Oct 2022 21:38:31 +0800 Subject: [PATCH] update finetune --- modelscope/preprocessors/ofa/image_captioning.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modelscope/preprocessors/ofa/image_captioning.py b/modelscope/preprocessors/ofa/image_captioning.py index 99eda15d..af623297 100644 --- a/modelscope/preprocessors/ofa/image_captioning.py +++ b/modelscope/preprocessors/ofa/image_captioning.py @@ -62,6 +62,6 @@ class OfaImageCaptioningPreprocessor(OfaBasePreprocessor): 'patch_image': patch_image, 'patch_mask': torch.tensor([True]) } - if self.column_map['text'] in data: + if 'text' in self.column_map and self.column_map['text'] in data: sample['label'] = data[self.column_map['text']] return sample