code: def export_model(model, filepath):
      export_archive = ExportArchive()
      export_archive.track(model)
      if isinstance(model, (Functional, Sequential)):
          input_signature = tf.nest.map_structure(
              _make_tensor_spec, model.inputs
          )
          if (
              isinstance(input_signature, list)
              and len(input_signature) > 1
          ):
              input_signature = [input_signature]
          export_archive.add_endpoint(
              "serve", model.__call__, input_signature
          )
      else:
          save_spec = _get_save_spec(model)
          if not save_spec or not model._called:
              raise ValueError(
                  "The model provided has never called. "
                  "It must be called at least once before export."
              )
          input_signature = [save_spec]
          export_archive.add_endpoint(
              "serve", model.__call__, input_signature
          )
      export_archive.write_out(filepath)
  
imports: from absl import logging
  from keras import backend
  from keras.api_export import keras_export
  from keras.layers import Layer
  from keras.models import Functional
  from keras.models import Sequential
  from keras.utils import io_utils
  from keras.utils.module_utils import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: export_model(model, filepath) without return types