def _save_encoder(self):
    """Save only the text encoder to disk."""
    if self._encoder is None:
      raise ValueError('Encoder is not initialized.')
    self._encoder.save_to_file(
        os.path.join(self._model_config.model_checkpoint, 'text_encoder'))
Save only the text encoder to disk.
language/serene/training.py