code: def run_models(
      dataset_name: str,
      model_name: str,
      gcs_bucket: str,
      train_split: str,
      validation_split: str,
      one_hot: Optional[bool] = True,
      epochs: Optional[int] = 100,
      batch_size: Optional[int] = 128,
      job_name: Optional[str] = "",
      **run_kwargs,
  ) -> Optional[Dict[str, str]]:
      """A wrapper for tfc.run that runs models from TF Model Garden on the Cloud.
  
      This method allows for running models from TF Model Garden using datasets
      from TFDS directly on the Cloud. Currently it only supports image
      classification models. Specifically ResNet and EfficientNet.
  
      Args:
        dataset_name: the registered name of the `DatasetBuilder` (the snake case
          version of the class name). This can be either `'dataset_name'` or
          `'dataset_name/config_name'` for datasets with `BuilderConfig`s.
        model_name: the name of the model. Currently it supports:
          -'resnet': For the resnet50 model.
          -'efficientnet': For the efficientnet-b0 model. -Any efficientnet
            configuration present in efficientnet_model.MODEL_CONFIGS. Use the key
            as it appears in the dictionary.
        gcs_bucket: The gcs bucket that is going to be used to build and store the
          training.
        train_split: Which split of the data to load for training. Available options
          depend on the dataset and can be found on the TFDS docs.
        validation_split: Which split of the data to load for validation. Available
          options depend on the dataset and can be found on the TFDS docs. If None
          is provided, then 0.2 of the training split will be used for validation.
        one_hot: If True it performs one hot encoding on the label, and it assumes
          the label is the index.
        epochs: The number of epochs that are going to be used for training.
        batch_size: The batch size to use during training.
        job_name: The name of the job in GCP.
        **run_kwargs: keyword arguments for `tfc.run()`.
  
      Returns:
        A dictionary with five keys.
          1. 'job_id': the training job id.
          2. 'docker_image': Docker image generated for the training job.
          3. 'tensorboard_logs': the path to the tensorboard logs registered
          during callbacks.
          4. 'model_checkpoint': the path to the model checkpoints registered
          during callbacks.
          5. 'saved_model': the path to the saved model.
      """
      model_dirs = get_model_dirs(gcs_bucket, job_name)
  
      if run.remote():
          classifier_trainer(
              dataset_name,
              model_name,
              batch_size,
              epochs,
              train_split,
              validation_split,
              one_hot,
              model_dirs,
          )
          return
  
      validate_input()
      if "job_labels" in run_kwargs and job_name:
          run_kwargs["job_labels"]["job"] = job_name
      elif job_name:
          run_kwargs["job_labels"] = {"job": job_name}
  
      run_results = run.run(**run_kwargs)
      run_results.update(model_dirs)
      return run_results
  
imports: import os
  import pickle
  from typing import Any, Dict, Optional
  import uuid
  from ..None import machine_config
  from ..None import run
  import tensorflow
  import tensorflow_datasets
  from official.legacy.image_classification.efficientnet import efficientnet_model
  from official.legacy.image_classification.resnet import resnet_model
label_desc: Use image node_id 1 for calling a global function with example usage: run_models(dataset_name, model_name, gcs_bucket, train_split, validation_split, one_hot, epochs, batch_size, job_name) and returns: run_results