code: def test_large_model_pt(self):
      dqa_pipeline = pipeline(
          "document-question-answering",
          model="tiennvcs/layoutlmv2-base-uncased-finetuned-docvqa",
          revision="9977165",
      )
      image = INVOICE_URL
      question = "What is the invoice number?"
  
      outputs = dqa_pipeline(image=image, question=question, top_k=2)
      self.assertEqual(
          nested_simplify(outputs, decimals=4),
          [
              {
                  "score": 0.9944,
                  "answer": "us-001",
                  "start": 16,
                  "end": 16,
              },
              {
                  "score": 0.0009,
                  "answer": "us-001",
                  "start": 16,
                  "end": 16,
              },
          ],
      )
  
      outputs = dqa_pipeline(
          {"image": image, "question": question}, top_k=2
      )
      self.assertEqual(
          nested_simplify(outputs, decimals=4),
          [
              {
                  "score": 0.9944,
                  "answer": "us-001",
                  "start": 16,
                  "end": 16,
              },
              {
                  "score": 0.0009,
                  "answer": "us-001",
                  "start": 16,
                  "end": 16,
              },
          ],
      )
  
      outputs = dqa_pipeline(
          [
              {"image": image, "question": question},
              {"image": image, "question": question},
          ],
          top_k=2,
      )
      self.assertEqual(
          nested_simplify(outputs, decimals=4),
          [
              [
                  {
                      "score": 0.9944,
                      "answer": "us-001",
                      "start": 16,
                      "end": 16,
                  },
                  {
                      "score": 0.0009,
                      "answer": "us-001",
                      "start": 16,
                      "end": 16,
                  },
              ],
          ]
          * 2,
      )
  
file_path: transformers/tests/pipelines/test_pipelines_document_question_answering.py
imports: import unittest
  from transformers import MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING, AutoTokenizer, is_vision_available
  from transformers.pipelines import pipeline
  from transformers.pipelines.document_question_answering import apply_tesseract
  from transformers.testing_utils import is_pipeline_test, nested_simplify, require_detectron2, require_pytesseract, require_tf, require_torch, require_vision, slow
  from .test_pipelines_common import ANY
label_desc: Use image node_id 4 for calling the DocumentQuestionAnsweringPipelineTests obj's underlying member method code with example usage: obj.test_large_model_pt() without return types