code: def _convert_to_half_precision(
      model_path: str, input_tfms: MultiStageTransformation
  ) -> str:
      model_path = Path(model_path)
      model_quant = model_path.parent.parent / "fp16"
      model_quant.mkdir(parents=True)
      model_quant = model_quant / (model_path.stem + "_fp16.onnx")
      new_onnx_model = convert_float_to_float16_model_path(
          str(model_path)
      )
      input_tfms.append(HalfPrecisionTransformation())
      try:
          onnx.save(new_onnx_model, str(model_quant))
      except ValueError:
          # Model larger than 2GB must be saved as external data
          onnx.save(
              new_onnx_model,
              str(model_quant),
              save_as_external_data=True,
              all_tensors_to_one_file=False,
              convert_attribute=True,
          )
      return str(model_quant)
  
file_path: nebuly/optimization/nebullvm/nebullvm/operations/optimizations/compilers/quantizations/onnx.py
imports: from pathlib import Path
  from typing import Union, Iterable, Tuple, List
  import cpuinfo
  import numpy
  from nebullvm.core.models import QuantizationType, Device, DeviceType
  from nebullvm.optional_modules.onnx import onnx, convert_float_to_float16_model_path
  from nebullvm.optional_modules.onnxruntime import CalibrationDataReader, QuantType, quantize_dynamic, quantize_static
  from nebullvm.optional_modules.torch import DataLoader
  from nebullvm.tools.onnx import get_input_names
  from nebullvm.tools.transformations import MultiStageTransformation, HalfPrecisionTransformation
label_desc: Use image node_id 4 for calling a global function with example usage: _convert_to_half_precision(model_path, input_tfms) and returns: str