code: def main():
      parser = argparse.ArgumentParser(
          "Hugging Face Optimum ONNX exporter"
      )
  
      parse_args_onnx(parser)
  
      # Retrieve CLI arguments
      args = parser.parse_args()
  
      # get the shapes to be used to generate dummy inputs
      input_shapes = {}
      for input_name in DEFAULT_DUMMY_SHAPES.keys():
          input_shapes[input_name] = getattr(args, input_name)
  
      main_export(
          model_name_or_path=args.model,
          output=args.output,
          task=args.task,
          opset=args.opset,
          device=args.device,
          fp16=args.fp16,
          optimize=args.optimize,
          monolith=args.monolith,
          no_post_process=args.no_post_process,
          framework=args.framework,
          atol=args.atol,
          cache_dir=args.cache_dir,
          trust_remote_code=args.trust_remote_code,
          pad_token_id=args.pad_token_id,
          for_ort=args.for_ort,
          library_name=args.library_name,
          legacy=args.legacy,
          **input_shapes,
      )
  
imports: import argparse
  import os
  from pathlib import Path
  from packaging import version
  from requests.exceptions import ConnectionError
  from transformers import AutoConfig, AutoTokenizer
  from transformers.utils import is_torch_available
  from ...commands.export.onnx import parse_args_onnx
  from ...configuration_utils import _transformers_version
  from ...utils import DEFAULT_DUMMY_SHAPES, ONNX_WEIGHTS_NAME, logging
  from ...utils.modeling_utils import MODEL_TO_PATCH_FOR_PAST
  from ...utils.save_utils import maybe_load_preprocessors, maybe_save_preprocessors
  from ..error_utils import AtolError, OutputMatchError, ShapeError
  from ..tasks import TasksManager
  from .base import OnnxConfigWithPast
  from .constants import SDPA_ARCHS_ONNX_EXPORT_NOT_SUPPORTED, UNPICKABLE_ARCHS
  from .convert import export_models, validate_models_outputs
  from .utils import MODEL_TYPES_REQUIRING_POSITION_IDS, _get_submodels_for_export_decoder, _get_submodels_for_export_encoder_decoder, _get_submodels_for_export_stable_diffusion, get_decoder_models_for_export, get_encoder_decoder_models_for_export, get_sam_models_for_export, get_speecht5_models_for_export, get_stable_diffusion_models_for_export
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Union
label_desc: Use image node_id 3 for calling a global function with example usage: main() without return types