code: def export_and_get_onnx_model(
      model_or_model_path,
      custom_output_path=saved_models_path,
      quantized=True,
  ):
      """
                            Method for whole pipeline,
      converts from pytorch to onnx --> quantizes model --> sets onnx runtime
                  --> builds whole onnx model with all sessions
  
      """
  
      # Step 1. convert huggingfaces t5 model to onnx
      onnx_model_paths = generate_onnx_representation(
          model_or_model_path, output_path=custom_output_path
      )
  
      if quantized:
          # Step 2. (recommended) quantize the converted model for fast inference and to reduce model size.
          quant_model_paths = quantize(onnx_model_paths)
  
          # step 3. setup onnx runtime
          print("Setting up onnx model...")
          model_sessions = get_onnx_runtime_sessions(quant_model_paths)
      else:
          print("Setting up onnx model...")
          model_sessions = get_onnx_runtime_sessions(onnx_model_paths)
  
      # step 4. get the onnx model
      model = OnnxT5(model_or_model_path, model_sessions)
      print("Done!")
  
      return model
  
imports: from .huggingface_utils import get_auth_token
  from .ort_settings import get_onnx_runtime_sessions
  from .onnx_exporter import generate_onnx_representation, quantize, get_model_paths, saved_models_path
  from pathlib import Path
  from transformers import AutoConfig, MT5Config, T5ForConditionalGeneration
  from transformers.modeling_outputs import Seq2SeqLMOutput, BaseModelOutput
  import torch
  import functools
  import operator
label_desc: Use image node_id 1 for calling a global function with example usage: export_and_get_onnx_model(model_or_model_path, custom_output_path, quantized) and returns: model