docstr: Run pipeline tests for a specific `task`
  
  Args:
      task (`str`):
          A task name. This should be a key in the mapping `pipeline_test_mapping`.
docstr_tok: ["Run","pipeline","tests","for","a","specific","`","task","`","Args",":","task","(","`","str","`",")",":","A","task","name",".","This","should","be","a","key","in","the","mapping","`","pipeline_test_mapping","`","."]
code: def run_task_tests(self, task):
      """Run pipeline tests for a specific `task`
  
      Args:
          task (`str`):
              A task name. This should be a key in the mapping `pipeline_test_mapping`.
      """
      if task not in self.pipeline_model_mapping:
          self.skipTest(
              f"{self.__class__.__name__}::test_pipeline_{task.replace('-', '_')} is skipped: `{task}` is not in "
              f"`self.pipeline_model_mapping` for `{self.__class__.__name__}`."
          )
  
      model_architectures = self.pipeline_model_mapping[task]
      if not isinstance(model_architectures, tuple):
          model_architectures = (model_architectures,)
      if not isinstance(model_architectures, tuple):
          raise ValueError(
              f"`model_architectures` must be a tuple. Got {type(model_architectures)} instead."
          )
  
      for model_architecture in model_architectures:
          model_arch_name = model_architecture.__name__
  
          # Get the canonical name
          for _prefix in ["Flax", "TF"]:
              if model_arch_name.startswith(_prefix):
                  model_arch_name = model_arch_name[len(_prefix) :]
                  break
  
          tokenizer_names = []
          processor_names = []
          commit = None
          if model_arch_name in tiny_model_summary:
              tokenizer_names = tiny_model_summary[model_arch_name][
                  "tokenizer_classes"
              ]
              processor_names = tiny_model_summary[model_arch_name][
                  "processor_classes"
              ]
              if "sha" in tiny_model_summary[model_arch_name]:
                  commit = tiny_model_summary[model_arch_name]["sha"]
          # Adding `None` (if empty) so we can generate tests
          tokenizer_names = (
              [None] if len(tokenizer_names) == 0 else tokenizer_names
          )
          processor_names = (
              [None] if len(processor_names) == 0 else processor_names
          )
  
          repo_name = f"tiny-random-{model_arch_name}"
          if TRANSFORMERS_TINY_MODEL_PATH != "hf-internal-testing":
              repo_name = model_arch_name
  
          self.run_model_pipeline_tests(
              task,
              repo_name,
              model_architecture,
              tokenizer_names,
              processor_names,
              commit,
          )
  
imports: import copy
  import json
  import os
  import random
  import unittest
  from pathlib import Path
  from transformers.testing_utils import is_pipeline_test, require_decord, require_pytesseract, require_timm, require_torch, require_torch_or_tf, require_vision
  from transformers.utils import direct_transformers_import, logging
  from .pipelines.test_pipelines_audio_classification import AudioClassificationPipelineTests
  from .pipelines.test_pipelines_automatic_speech_recognition import AutomaticSpeechRecognitionPipelineTests
  from .pipelines.test_pipelines_conversational import ConversationalPipelineTests
  from .pipelines.test_pipelines_depth_estimation import DepthEstimationPipelineTests
  from .pipelines.test_pipelines_document_question_answering import DocumentQuestionAnsweringPipelineTests
  from .pipelines.test_pipelines_feature_extraction import FeatureExtractionPipelineTests
  from .pipelines.test_pipelines_fill_mask import FillMaskPipelineTests
  from .pipelines.test_pipelines_image_classification import ImageClassificationPipelineTests
  from .pipelines.test_pipelines_image_segmentation import ImageSegmentationPipelineTests
  from .pipelines.test_pipelines_image_to_image import ImageToImagePipelineTests
  from .pipelines.test_pipelines_image_to_text import ImageToTextPipelineTests
  from .pipelines.test_pipelines_mask_generation import MaskGenerationPipelineTests
  from .pipelines.test_pipelines_object_detection import ObjectDetectionPipelineTests
  from .pipelines.test_pipelines_question_answering import QAPipelineTests
  from .pipelines.test_pipelines_summarization import SummarizationPipelineTests
  from .pipelines.test_pipelines_table_question_answering import TQAPipelineTests
  from .pipelines.test_pipelines_text2text_generation import Text2TextGenerationPipelineTests
  from .pipelines.test_pipelines_text_classification import TextClassificationPipelineTests
  from .pipelines.test_pipelines_text_generation import TextGenerationPipelineTests
  from .pipelines.test_pipelines_text_to_audio import TextToAudioPipelineTests
  from .pipelines.test_pipelines_token_classification import TokenClassificationPipelineTests
  from .pipelines.test_pipelines_translation import TranslationPipelineTests
  from .pipelines.test_pipelines_video_classification import VideoClassificationPipelineTests
  from .pipelines.test_pipelines_visual_question_answering import VisualQuestionAnsweringPipelineTests
  from .pipelines.test_pipelines_zero_shot import ZeroShotClassificationPipelineTests
  from .pipelines.test_pipelines_zero_shot_audio_classification import ZeroShotAudioClassificationPipelineTests
  from .pipelines.test_pipelines_zero_shot_image_classification import ZeroShotImageClassificationPipelineTests
  from .pipelines.test_pipelines_zero_shot_object_detection import ZeroShotObjectDetectionPipelineTests
label_desc: Use image node_id 1 for calling the PipelineTesterMixin obj's underlying member method code with example usage: obj.run_task_tests(task) without return types