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: Export this predictor's model to an ONNX file.
  
  When `path` argument is not provided, the method would not save the model into disk.
  Instead, it would export the onnx model into BytesIO and return its binary as bytes.
  
  Parameters
  ----------
  data
      Raw data used to trace and export the model.
      If this is None, will check if a processed batch is provided.
  path : str, default=None
      The export path of onnx model. If path is not provided, the method would export model to memory.
  batch_size
      The batch_size of export model's input.
      Normally the batch_size is a dynamic axis, so we could use a small value for faster export.
  verbose
      verbose flag in torch.onnx.export.
  opset_version
      opset_version flag in torch.onnx.export.
  truncate_long_and_double: bool, default False
      Truncate weights provided in int64 or double (float64) to int32 and float32
  
  Returns
  -------
  onnx_path : str or bytes
      A string that indicates location of the exported onnx model, if `path` argument is provided.
      Otherwise, would return the onnx model as bytes.
docstr_tok: ["Export","this","predictor","'s","model","to","an","ONNX","file",".","When","`","path","`","argument","is","not","provided",",","the","method","would","not","save","the","model","into","disk",".","Instead",",","it","would","export","the","onnx","model","into","BytesIO","and","return","its","binary","as","bytes",".","Parameters","--","--","--","--","--","data","Raw","data","used","to","trace","and","export","the","model",".","If","this","is","None",",","will","check","if","a","processed","batch","is","provided",".","path",":","str",",","default=None","The","export","path","of","onnx","model",".","If","path","is","not","provided",",","the","method","would","export","model","to","memory",".","batch_size","The","batch_size","of","export","model","'s","input",".","Normally","the","batch_size","is","a","dynamic","axis",",","so","we","could","use","a","small","value","for","faster","export",".","verbose","verbose","flag","in","torch.onnx.export",".","opset_version","opset_version","flag","in","torch.onnx.export",".","truncate_long_and_double",":","bool",",","default","False","Truncate","weights","provided","in","int64","or","double","(","float64",")","to","int32","and","float32","Returns","--","--","--","-","onnx_path",":","str","or","bytes","A","string","that","indicates","location","of","the","exported","onnx","model",",","if","`","path","`","argument","is","provided",".","Otherwise",",","would","return","the","onnx","model","as","bytes","."]
code: def export_onnx(
      self,
      data: Union[dict, pd.DataFrame],
      path: Optional[str] = None,
      batch_size: Optional[int] = None,
      verbose: Optional[bool] = False,
      opset_version: Optional[int] = 16,
      truncate_long_and_double: Optional[bool] = False,
  ):
      """
      Export this predictor's model to an ONNX file.
  
      When `path` argument is not provided, the method would not save the model into disk.
      Instead, it would export the onnx model into BytesIO and return its binary as bytes.
  
      Parameters
      ----------
      data
          Raw data used to trace and export the model.
          If this is None, will check if a processed batch is provided.
      path : str, default=None
          The export path of onnx model. If path is not provided, the method would export model to memory.
      batch_size
          The batch_size of export model's input.
          Normally the batch_size is a dynamic axis, so we could use a small value for faster export.
      verbose
          verbose flag in torch.onnx.export.
      opset_version
          opset_version flag in torch.onnx.export.
      truncate_long_and_double: bool, default False
          Truncate weights provided in int64 or double (float64) to int32 and float32
  
      Returns
      -------
      onnx_path : str or bytes
          A string that indicates location of the exported onnx model, if `path` argument is provided.
          Otherwise, would return the onnx model as bytes.
      """
  
      # Make sure _model is initialized
      self._learner.on_predict_start()
  
      return self._learner.export_onnx(
          data=data,
          path=path,
          batch_size=batch_size,
          verbose=verbose,
          opset_version=opset_version,
          truncate_long_and_double=truncate_long_and_double,
      )
  
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 30 for calling the MultiModalPredictor obj's underlying member method code with example usage: obj.export_onnx(data, path, batch_size, verbose, opset_version, truncate_long_and_double) and returns: self