class_docstr: Wrapper class for Mesh-TF models.
class_docstr_tok: ["Wrapper","class","for","Mesh-TF","models","."]
docstr: Finetunes a model from an existing checkpoint.
  
  Args:
    mixture_or_task_name: str, the name of the Mixture or Task to evaluate on.
      Must be pre-registered in the global `TaskRegistry` or
      `MixtureRegistry.`
    finetune_steps: int, the number of additional steps to train for.
    pretrained_model_dir: str, directory with pretrained model checkpoints and
      operative config.
    pretrained_checkpoint_step: int, checkpoint to initialize weights from. If
      -1 (default), use the latest checkpoint from the pretrained model
      directory.
    split: str, the mixture/task split to finetune on.
docstr_tok: ["Finetunes","a","model","from","an","existing","checkpoint",".","Args",":","mixture_or_task_name",":","str",",","the","name","of","the","Mixture","or","Task","to","evaluate","on",".","Must","be","pre-registered","in","the","global","`","TaskRegistry","`","or","`","MixtureRegistry.","`","finetune_steps",":","int",",","the","number","of","additional","steps","to","train","for",".","pretrained_model_dir",":","str",",","directory","with","pretrained","model","checkpoints","and","operative","config",".","pretrained_checkpoint_step",":","int",",","checkpoint","to","initialize","weights","from",".","If","-1","(","default",")",",","use","the","latest","checkpoint","from","the","pretrained","model","directory",".","split",":","str",",","the","mixture\/task","split","to","finetune","on","."]
code: def finetune(
      self,  # pytype: disable=signature-mismatch  # overriding-parameter-count-checks
      mixture_or_task_name,
      finetune_steps,
      pretrained_model_dir,
      pretrained_checkpoint_step=-1,
      split="train",
  ):
      """Finetunes a model from an existing checkpoint.
  
      Args:
        mixture_or_task_name: str, the name of the Mixture or Task to evaluate on.
          Must be pre-registered in the global `TaskRegistry` or
          `MixtureRegistry.`
        finetune_steps: int, the number of additional steps to train for.
        pretrained_model_dir: str, directory with pretrained model checkpoints and
          operative config.
        pretrained_checkpoint_step: int, checkpoint to initialize weights from. If
          -1 (default), use the latest checkpoint from the pretrained model
          directory.
        split: str, the mixture/task split to finetune on.
      """
      if pretrained_checkpoint_step == -1:
          checkpoint_step = utils.get_latest_checkpoint_from_dir(
              pretrained_model_dir
          )
      else:
          checkpoint_step = pretrained_checkpoint_step
      _parse_operative_config(pretrained_model_dir)
  
      model_ckpt = "model.ckpt-" + str(checkpoint_step)
      self.train(
          mixture_or_task_name,
          checkpoint_step + finetune_steps,
          init_checkpoint=os.path.join(
              pretrained_model_dir, model_ckpt
          ),
          split=split,
      )
  
imports: import functools
  import os
  import gin
  import gin.tf
  import mesh_tensorflow
  from mesh_tensorflow import optimize
  from mesh_tensorflow.transformer import dataset
  from mesh_tensorflow.transformer import learning_rate_schedules
  from mesh_tensorflow.transformer import utils
  from t5.models import mesh_transformer
  from t5.models import utils
  from t5.models.t5_model import T5Model
  import tensorflow.compat.v1
label_desc: Use image node_id 8 for calling the MtfModel obj's underlying member method code with example usage: obj.finetune(mixture_or_task_name, finetune_steps, pretrained_model_dir, pretrained_checkpoint_step, split) without return types