code: def main():
      parser = ArgumentParser()
      parser.add_argument(
          "--asr_model",
          type=str,
          default="QuartzNet15x5Base-En",
          required=True,
          help="Pass: 'QuartzNet15x5Base-En'",
      )
      parser.add_argument(
          "--asr_onnx",
          type=str,
          default="./QuartzNet15x5Base-En-max-32.onnx",
          help="Pass: 'QuartzNet15x5Base-En-max-32.onnx'",
      )
      parser.add_argument(
          "--dataset",
          type=str,
          required=True,
          help="path to evaluation data",
      )
      parser.add_argument("--batch_size", type=int, default=4)
      parser.add_argument(
          "--dont_normalize_text",
          default=False,
          action="store_false",
          help="Turn off trasnscript normalization. Recommended for non-English.",
      )
      parser.add_argument(
          "--use_cer",
          default=False,
          action="store_true",
          help="Use Character Error Rate as the evaluation metric",
      )
      parser.add_argument(
          "--qat",
          action="store_true",
          help="Use onnx file exported from QAT tools",
      )
      args = parser.parse_args()
      torch.set_grad_enabled(False)
  
      if args.asr_model.endswith(".nemo"):
          logging.info(f"Using local ASR model from {args.asr_model}")
          asr_model_cfg = EncDecCTCModel.restore_from(
              restore_path=args.asr_model, return_config=True
          )
          with open_dict(asr_model_cfg):
              asr_model_cfg.encoder.quantize = True
          asr_model = EncDecCTCModel.restore_from(
              restore_path=args.asr_model,
              override_config_path=asr_model_cfg,
          )
  
      else:
          logging.info(f"Using NGC cloud ASR model {args.asr_model}")
          asr_model_cfg = EncDecCTCModel.from_pretrained(
              model_name=args.asr_model, return_config=True
          )
          with open_dict(asr_model_cfg):
              asr_model_cfg.encoder.quantize = True
          asr_model = EncDecCTCModel.from_pretrained(
              model_name=args.asr_model,
              override_config_path=asr_model_cfg,
          )
      asr_model.setup_test_data(
          test_data_config={
              "sample_rate": 16000,
              "manifest_filepath": args.dataset,
              "labels": asr_model.decoder.vocabulary,
              "batch_size": args.batch_size,
              "normalize_transcripts": args.dont_normalize_text,
          }
      )
      asr_model.preprocessor.featurizer.dither = 0.0
      asr_model.preprocessor.featurizer.pad_to = 0
      if can_gpu:
          asr_model = asr_model.cuda()
      asr_model.eval()
      labels_map = dict(
          [
              (i, asr_model.decoder.vocabulary[i])
              for i in range(len(asr_model.decoder.vocabulary))
          ]
      )
      decoding_cfg = CTCDecodingConfig()
      char_decoding = CTCDecoding(decoding_cfg, vocabulary=labels_map)
      wer = WER(char_decoding, use_cer=args.use_cer)
      wer_result = evaluate(
          asr_model, args.asr_onnx, labels_map, wer, args.qat
      )
      logging.info(f"Got WER of {wer_result}.")
  
file_path: NeMo/examples/asr/quantization/speech_to_text_quant_infer_trt.py
imports: import os
  from argparse import ArgumentParser
  import numpy
  import pycuda.driver
  import tensorrt
  import torch
  from omegaconf import open_dict
  from nemo.collections.asr.metrics.wer import WER, word_error_rate
  from nemo.collections.asr.models import EncDecCTCModel
  from nemo.collections.asr.parts.submodules.ctc_decoding import CTCDecoding, CTCDecodingConfig
  from nemo.utils import logging
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types