code: def test_custom_class(self):
      task = TasksManager.infer_task_from_model(
          "google/pix2struct-base"
      )
      self.assertEqual(task, "image-to-text")
  
      model = TasksManager.get_model_from_task(
          "image-to-text", "google/pix2struct-base"
      )
      self.assertTrue(
          isinstance(model, Pix2StructForConditionalGeneration)
      )
  
      model = TasksManager.get_model_from_task(
          "question-answering", "uclanlp/visualbert-vqa"
      )
      self.assertTrue(isinstance(model, VisualBertForQuestionAnswering))
  
file_path: optimum/tests/exporters/common/test_tasks_manager.py
imports: import importlib
  import inspect
  from typing import Optional, Set
  from unittest import TestCase
  import pytest
  from transformers import BertConfig, Pix2StructForConditionalGeneration, VisualBertForQuestionAnswering
  from transformers.testing_utils import slow
  from optimum.exporters import TasksManager
  from optimum.exporters.onnx.model_configs import BertOnnxConfig
label_desc: Use image node_id 5 for calling the TasksManagerTestCase obj's underlying member method code with example usage: obj.test_custom_class() without return types