code: def convert_to_tflite(
      model: tf.keras.Model,
      quantization_config: Optional[
          quantization.QuantizationConfig
      ] = None,
      supported_ops: Tuple[tf.lite.OpsSet, ...] = (
          tf.lite.OpsSet.TFLITE_BUILTINS,
      ),
      preprocess: Optional[Callable[..., Any]] = None,
      allow_custom_ops: bool = False,
  ) -> bytearray:
      """Converts the input Keras model to TFLite format.
  
      Args:
        model: Keras model to be converted to TFLite.
        quantization_config: Configuration for post-training quantization.
        supported_ops: A list of supported ops in the converted TFLite file.
        preprocess: A callable to preprocess the representative dataset for
          quantization. The callable takes three arguments in order: feature, label,
          and is_training.
        allow_custom_ops: A boolean flag to enable custom ops in model conversion.
          Default to False.
  
      Returns:
        bytearray of TFLite model
      """
      with tempfile.TemporaryDirectory() as temp_dir:
          save_path = os.path.join(temp_dir, "saved_model")
          model.save(
              save_path,
              include_optimizer=False,
              save_format="tf",
          )
          return convert_to_tflite_from_file(
              save_path,
              quantization_config,
              supported_ops,
              preprocess,
              allow_custom_ops,
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import tempfile
  from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
  import numpy
  import tensorflow
  from mediapipe.model_maker.python.core.data import dataset
  from mediapipe.model_maker.python.core.utils import quantization
label_desc: Use image node_id 6 for calling a global function with example usage: convert_to_tflite(model, quantization_config, supported_ops, preprocess, allow_custom_ops) and returns: convert_to_tflite_from_file