From 02daaaf614d4ae08fa6a1d51693baaf7de819585 Mon Sep 17 00:00:00 2001 From: Ankur Goyal Date: Mon, 8 Aug 2022 22:03:50 -0700 Subject: [PATCH] Small arg handling fixes --- pipeline_document_question_answering.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipeline_document_question_answering.py b/pipeline_document_question_answering.py index 6048eeb..083da25 100644 --- a/pipeline_document_question_answering.py +++ b/pipeline_document_question_answering.py @@ -221,7 +221,7 @@ class DocumentQuestionAnsweringPipeline(Pipeline): image = None image_features = {} - if "image" in input: + if input.get("image", None) is not None: if not VISION_LOADED: raise ValueError( "If you provide an image, then the pipeline will run process it with PIL (Pillow), but"