code: def run_fn(fn_args):
      """Train the model based on given args.
  
      Args:
        fn_args: Holds args used to train the model as name/value pairs.
      """
      schema = tfx.utils.parse_pbtxt_file(
          fn_args.schema_file, schema_pb2.Schema()
      )
  
      train_and_eval_spec = _create_train_and_eval_spec(fn_args, schema)
  
      # Train the model
      logging.info("Training model.")
      tf_estimator.train_and_evaluate(
          train_and_eval_spec["estimator"],
          train_and_eval_spec["train_spec"],
          train_and_eval_spec["eval_spec"],
      )
      logging.info(
          "Training complete.  Model written to %s",
          fn_args.serving_model_dir,
      )
  
      # Export an eval savedmodel for TFMA
      # NOTE: When trained in distributed training cluster, eval_savedmodel must be
      # exported only by the chief worker.
      logging.info("Exporting eval_savedmodel for TFMA.")
      tfma.export.export_eval_savedmodel(
          estimator=train_and_eval_spec["estimator"],
          export_dir_base=fn_args.eval_model_dir,
          eval_input_receiver_fn=train_and_eval_spec[
              "eval_input_receiver_fn"
          ],
      )
  
      logging.info(
          "Exported eval_savedmodel to %s.", fn_args.eval_model_dir
      )
  
file_path: tfx/tfx/experimental/templates/taxi/models/estimator_model/model.py
imports: from absl import logging
  import tensorflow
  from tensorflow import estimator
  import tensorflow_model_analysis
  import tensorflow_transform
  from tensorflow_transform.tf_metadata import schema_utils
  from tfx import v1
  from tfx.experimental.templates.taxi.models import features
  from tfx.experimental.templates.taxi.models.estimator_model import constants
  from tfx_bsl.public import tfxio
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 8 for calling a global function with example usage: run_fn(fn_args) without return types