code: def convert_keras_to_onnx(
      model: tf.keras.Model,
      model_params: ModelParams,
      output_file_path: Union[str, Path],
  ):
      """Convert keras models into ONNX.
  
      Args:
          model (tf.keras.Model): keras model.
          model_params (ModelParams): Model Parameters as input sizes and
              dynamic axis information.
          output_file_path (Path): Path where storing the output file.
      """
      # get data types for each input
      dtypes = [
          model_params.input_infos[i].dtype.value
          for i in range(len(model_params.input_infos))
      ]
      # get input shapes for each input
      shapes = [
          [int(x) for x in model_params.input_infos[i].size]
          for i in range(len(model_params.input_infos))
      ]
      # set the dynamic axes for each input
      if isinstance(model, TensorFlowTransformerWrapper):
          names = list(model.inputs_types.keys())
      else:
          names = [
              f"input_{i}" for i in range(len(model_params.input_infos))
          ]
  
      input_signature = tuple(
          tf.TensorSpec(
              (
                  None
                  if model_params.dynamic_info is not None
                  and dim in model_params.dynamic_info.inputs[i]
                  else shape[dim]
                  for dim in range(len(shape))
              ),
              dtype,
              name=name,
          )
          for i, (shape, dtype, name) in enumerate(
              zip(shapes, dtypes, names)
          )
      )
  
      onnx_model, _ = tf2onnx.convert.from_keras(
          model,
          input_signature,
          opset=ONNX_OPSET_VERSION,
          output_path=output_file_path,
      )
  
      return output_file_path
  
file_path: nebuly/optimization/nebullvm/nebullvm/operations/conversions/tensorflow.py
imports: import subprocess
  from pathlib import Path
  from tempfile import TemporaryDirectory
  from typing import Union
  from loguru import logger
  from nebullvm.config import ONNX_OPSET_VERSION
  from nebullvm.core.models import ModelParams
  from nebullvm.optional_modules.tensorflow import tensorflow, tf2onnx
  from nebullvm.optional_modules.onnx import onnx
  from nebullvm.tools.huggingface import TensorFlowTransformerWrapper
label_desc: Use image node_id 3 for calling a global function with example usage: convert_keras_to_onnx(model, model_params, output_file_path) and returns: output_file_path