def load(cls,
           model_checkpoint,
           model_config_overrides = None,
           **kwargs):
    """Load the model, its tokenizer, and weights from the checkpoint.

    Args:
      model_checkpoint: Checkpoint to restore from, from .save()
      model_config_overrides: Extra args for ModelConfig
      **kwargs: Passed through to trainer, used for overriding checkpoint

    Returns:
      A model in the same state as just before it was saved with .save()
    """
    # pylint: disable=protected-access
    model_config = ModelConfig.from_file(
        os.path.join(model_checkpoint, 'model_config.json'),
        overrides=model_config_overrides)
    trainer = Trainer(model_config=model_config, **kwargs)
    trainer._tokenizer = trainer._build_tokenizer()
    encoder_path = os.path.join(model_checkpoint, 'text_encoder')
    if model_config.text_encoder == 'bert':
      trainer._encoder = preprocessing.BertTextEncoder.load_from_file(
          encoder_path)
    elif model_config.text_encoder == 'basic':
      trainer._encoder = preprocessing.BasicTextEncoder.load_from_file(
          encoder_path)
    else:
      raise ValueError('Invalid text encoder')

    trainer._compile()
    if trainer._model is None:
      raise ValueError('Model does not exist despite being compiled')
    trainer._model.load_weights(os.path.join(model_checkpoint, 'best_model.tf'))
    return trainer
Load the model, its tokenizer, and weights from the checkpoint.

    Args:
      model_checkpoint: Checkpoint to restore from, from .save()
      model_config_overrides: Extra args for ModelConfig
      **kwargs: Passed through to trainer, used for overriding checkpoint

    Returns:
      A model in the same state as just before it was saved with .save()
    
language/serene/training.py