def METHOD_NAME(tokenizer_vocab_path):
  tokenizer = load_tokenizer(tokenizer_vocab_path)
  @flax.struct.dataclass
  class WER(
      metrics.CollectingMetric.from_outputs(
          ('decoded', 'decoded_paddings', 'targets', 'target_paddings'))):
    """Computes the mean average precision for a binary classifier on CPU."""
    def compute(self):
      if tokenizer is None:
        return 0
      values = super().compute()
      # Ensure the arrays are numpy and not jax.numpy.
      values = {k: np.array(v) for k, v in values.items()}
      word_errors, num_words = compute_wer(
        values['decoded'],
        values['decoded_paddings'],
        values['targets'].astype(np.int32),
        values['target_paddings'],
        tokenizer)
      return word_errors / num_words
  return WER