Error in the pipeline

#13
by jimazmarin - opened

I get the following error when running the example: transformers version 4.29.2

NameError Traceback (most recent call last)
Cell In [2], line 3
1 from transformers import pipeline
----> 3 nlp = pipeline(
4 "document-question-answering",
5 model="impira/layoutlm-document-qa",
6 )
8 nlp(
9 "https://templates.invoicehome.com/invoice-template-us-neat-750px.png style="color:rgb(175,0,0)">",
10 "What is the invoice number?"
11 )

File /usr/local/lib/python3.8/dist-packages/transformers/pipelines/init.py:988, in pipeline(task, model, config, tokenizer, feature_extractor, image_processor, framework, revision, use_fast, use_auth_token, device, device_map, torch_dtype, trust_remote_code, model_kwargs, pipeline_class, **kwargs)
985 if device is not None:
986 kwargs["device"] = device
--> 988 return pipeline_class(model=model, framework=framework, task=task, **kwargs)

File /usr/local/lib/python3.8/dist-packages/transformers/pipelines/document_question_answering.py:145, in DocumentQuestionAnsweringPipeline.init(self, *args, **kwargs)
143 raise ValueError("Currently, the only supported VisionEncoderDecoder model is Donut")
144 else:
--> 145 self.check_model_type(MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING)
146 if self.model.config.class.name == "LayoutLMConfig":
147 self.model_type = ModelType.LayoutLM

NameError: name 'MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING' is not defined

Hi, Did you find any fix for this issue?

Sign up or log in to comment