class_docstr: Handles the `task name -> model class` and `architecture -> configuration` mappings.
docstr: Retrieves the `task -> exporter backend config constructors` map from the model type.
  
  Args:
      model_type (`str`):
          The model type to retrieve the supported tasks for.
      exporter (`str`):
          The name of the exporter.
      model_name (`Optional[str]`, defaults to `None`):
          The name attribute of the model object, only used for the exception message.
      library_name (defaults to `transformers`):
           The library name of the model.
  
  Returns:
      `TaskNameToExportConfigDict`: The dictionary mapping each task to a corresponding `ExportConfig`
      constructor.
docstr_tok: ["Retrieves","the","`","task","-",">","exporter","backend","config","constructors","`","map","from","the","model","type",".","Args",":","model_type","(","`","str","`",")",":","The","model","type","to","retrieve","the","supported","tasks","for",".","exporter","(","`","str","`",")",":","The","name","of","the","exporter",".","model_name","(","`","Optional","[","str","]","`",",","defaults","to","`","None","`",")",":","The","name","attribute","of","the","model","object",",","only","used","for","the","exception","message",".","library_name","(","defaults","to","`","transformers","`",")",":","The","library","name","of","the","model",".","Returns",":","`","TaskNameToExportConfigDict","`",":","The","dictionary","mapping","each","task","to","a","corresponding","`","ExportConfig","`","constructor","."]
code: def get_supported_tasks_for_model_type(
      model_type: str,
      exporter: str,
      model_name: Optional[str] = None,
      library_name: str = "transformers",
  ) -> TaskNameToExportConfigDict:
      """
      Retrieves the `task -> exporter backend config constructors` map from the model type.
  
      Args:
          model_type (`str`):
              The model type to retrieve the supported tasks for.
          exporter (`str`):
              The name of the exporter.
          model_name (`Optional[str]`, defaults to `None`):
              The name attribute of the model object, only used for the exception message.
          library_name (defaults to `transformers`):
               The library name of the model.
  
      Returns:
          `TaskNameToExportConfigDict`: The dictionary mapping each task to a corresponding `ExportConfig`
          constructor.
      """
      model_type = model_type.lower().replace("_", "-")
      model_type_and_model_name = (
          f"{model_type} ({model_name})" if model_name else model_type
      )
  
      default_model_type = None
      if library_name in TasksManager._MODEL_TYPE_FOR_DEFAULT_CONFIG:
          default_model_type = (
              TasksManager._MODEL_TYPE_FOR_DEFAULT_CONFIG[library_name]
          )
  
      if model_type not in TasksManager._SUPPORTED_MODEL_TYPE:
          if default_model_type is not None:
              model_type = default_model_type
          else:
              raise KeyError(
                  f"{model_type_and_model_name} is not supported yet for {library_name}. "
                  f"Only {list(TasksManager._SUPPORTED_MODEL_TYPE.keys())} are supported. "
                  f"If you want to support {model_type} please propose a PR or open up an issue."
              )
      if exporter not in TasksManager._SUPPORTED_MODEL_TYPE[model_type]:
          raise KeyError(
              f"{model_type_and_model_name} is not supported yet with the {exporter} backend. "
              f"Only {list(TasksManager._SUPPORTED_MODEL_TYPE[model_type].keys())} are supported. "
              f"If you want to support {exporter} please propose a PR or open up an issue."
          )
  
      return TasksManager._SUPPORTED_MODEL_TYPE[model_type][exporter]
  
imports: import importlib
  import inspect
  import itertools
  import json
  import os
  from functools import partial
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
  import huggingface_hub
  from packaging import version
  from requests.exceptions import ConnectionError
  from transformers import AutoConfig, PretrainedConfig, is_tf_available, is_torch_available
  from transformers.utils import SAFE_WEIGHTS_NAME, TF2_WEIGHTS_NAME, WEIGHTS_NAME, logging
  from ..utils import CONFIG_NAME
  from ..utils.import_utils import is_onnx_available
label_desc: Use image node_id 2 for calling the TasksManager obj's underlying member method code with example usage: obj.get_supported_tasks_for_model_type(model_type, exporter, model_name, library_name) and returns: TasksManager