def validate(self):
    """Validate that the arguments to the config are correct, error if not."""
    if self.tokenizer not in ['bert', 'basic']:
      raise ValueError(f'Invalid tokenizer: "{self.tokenizer}"')

    if self.text_encoder not in ['bert', 'basic']:
      raise ValueError(f'Invalid text encoder: "{self.text_encoder}"')

    if self.matcher not in layers.matcher_registry:
      raise ValueError(f'Invalid matcher: "{self.matcher}"')

    if self.contextualizer not in ['bert', 'rnn', 'lstm', 'gru']:
      raise ValueError(f'Invalid contextualizer: "{self.contextualizer}"')

    if self.model not in ['one_tower', 'two_tower']:
      raise ValueError(f'Invalid model: "{self.model}"')

    if self.bert_model_name not in ['base', 'large']:
      raise ValueError(f'Invalid bert model: "{self.bert_model_name}')

    if self.embedder not in ['classic_embedder', 'bert_embedder']:
      raise ValueError(f'Invalid embedder: "{self.embedder}"')
Validate that the arguments to the config are correct, error if not.
language/serene/training.py