class_docstr: AutoMM is designed to simplify the fine-tuning of foundation models
  for downstream applications with just three lines of code.
  AutoMM seamlessly integrates with popular model zoos such as
  `HuggingFace Transformers <https://github.com/huggingface/transformers>`_,
  `TIMM <https://github.com/huggingface/pytorch-image-models>`_,
  and `MMDetection <https://github.com/open-mmlab/mmdetection>`_,
  accommodating a diverse range of data modalities,
  including image, text, tabular, and document data, whether used individually or in combination.
  It offers support for an array of tasks, encompassing classification, regression,
  object detection, named entity recognition, semantic matching, and image segmentation.
class_docstr_tok: ["AutoMM","is","designed","to","simplify","the","fine-tuning","of","foundation","models","for","downstream","applications","with","just","three","lines","of","code",".","AutoMM","seamlessly","integrates","with","popular","model","zoos","such","as","`","HuggingFace","Transformers","<","https",":","\/\/github.com\/huggingface\/transformers",">","`","_",",","`","TIMM","<","https",":","\/\/github.com\/huggingface\/pytorch-image-models",">","`","_",",","and","`","MMDetection","<","https",":","\/\/github.com\/open-mmlab\/mmdetection",">","`","_",",","accommodating","a","diverse","range","of","data","modalities",",","including","image",",","text",",","tabular",",","and","document","data",",","whether","used","individually","or","in","combination",".","It","offers","support","for","an","array","of","tasks",",","encompassing","classification",",","regression",",","object","detection",",","named","entity","recognition",",","semantic","matching",",","and","image","segmentation","."]
docstr: Optimize the predictor's model for inference.
  
  Under the hood, the implementation would convert the PyTorch module into an ONNX module, so that
  we can leverage efficient execution providers in onnxruntime for faster inference.
  
  Parameters
  ----------
  providers : dict or str, default=None
      A list of execution providers for model prediction in onnxruntime.
  
      By default, the providers argument is None. The method would generate an ONNX module that
      would perform model inference with TensorrtExecutionProvider in onnxruntime, if tensorrt
      package is properly installed. Otherwise, the onnxruntime would fallback to use CUDA or CPU
      execution providers instead.
  
  Returns
  -------
  onnx_module : OnnxModule
      The onnx-based module that can be used to replace predictor._model for model inference.
docstr_tok: ["Optimize","the","predictor","'s","model","for","inference",".","Under","the","hood",",","the","implementation","would","convert","the","PyTorch","module","into","an","ONNX","module",",","so","that","we","can","leverage","efficient","execution","providers","in","onnxruntime","for","faster","inference",".","Parameters","--","--","--","--","--","providers",":","dict","or","str",",","default=None","A","list","of","execution","providers","for","model","prediction","in","onnxruntime",".","By","default",",","the","providers","argument","is","None",".","The","method","would","generate","an","ONNX","module","that","would","perform","model","inference","with","TensorrtExecutionProvider","in","onnxruntime",",","if","tensorrt","package","is","properly","installed",".","Otherwise",",","the","onnxruntime","would","fallback","to","use","CUDA","or","CPU","execution","providers","instead",".","Returns","--","--","--","-","onnx_module",":","OnnxModule","The","onnx-based","module","that","can","be","used","to","replace","predictor._model","for","model","inference","."]
code: def optimize_for_inference(
      self,
      providers: Optional[Union[dict, List[str]]] = None,
  ):
      """
      Optimize the predictor's model for inference.
  
      Under the hood, the implementation would convert the PyTorch module into an ONNX module, so that
      we can leverage efficient execution providers in onnxruntime for faster inference.
  
      Parameters
      ----------
      providers : dict or str, default=None
          A list of execution providers for model prediction in onnxruntime.
  
          By default, the providers argument is None. The method would generate an ONNX module that
          would perform model inference with TensorrtExecutionProvider in onnxruntime, if tensorrt
          package is properly installed. Otherwise, the onnxruntime would fallback to use CUDA or CPU
          execution providers instead.
  
      Returns
      -------
      onnx_module : OnnxModule
          The onnx-based module that can be used to replace predictor._model for model inference.
      """
      return self._learner.optimize_for_inference(providers=providers)
  
imports: from __future__ import annotations
  import json
  import logging
  import os
  import warnings
  from typing import Dict, List, Optional, Union
  import pandas
  import transformers
  from autogluon.common.utils.log_utils import set_logger_verbosity, verbosity2loglevel
  from autogluon.core.metrics import Scorer
  from .constants import AUTOMM_TUTORIAL_MODE, FEW_SHOT_CLASSIFICATION, NER, OBJECT_DETECTION, OPEN_VOCABULARY_OBJECT_DETECTION, SEMANTIC_SEGMENTATION
  from .learners import BaseLearner, FewShotSVMLearner, MultiModalMatcher, NERLearner, ObjectDetectionLearner, SemanticSegmentationLearner
  from .problem_types import PROBLEM_TYPES_REG
  from .utils import get_dir_ckpt_paths
label_desc: Use image node_id 31 for calling the MultiModalPredictor obj's underlying member method code with example usage: obj.optimize_for_inference(providers) and returns: self