docstr: For comparision run:
  >>> import t5  # pip install t5==0.7.1
  >>> from t5.data.sentencepiece_vocabulary import SentencePieceVocabulary
  
  >>> path_to_mtf_small_mt5_checkpoint = '<fill_in>'
  >>> path_to_mtf_small_mt5_spm_model_path = '<fill_in>'
  >>> t5_model = t5.models.MtfModel(model_dir=path_to_mtf_small_mt5_checkpoint, batch_size=1, tpu=None)
  >>> vocab = SentencePieceVocabulary(path_to_mtf_small_mt5_spm_model_path, extra_ids=100)
  >>> score = t5_model.score(inputs=["Hello there"], targets=["Hi I am"], vocabulary=vocab)
code: def test_small_integration_test(self):
      """
      For comparision run:
      >>> import t5  # pip install t5==0.7.1
      >>> from t5.data.sentencepiece_vocabulary import SentencePieceVocabulary
  
      >>> path_to_mtf_small_mt5_checkpoint = '<fill_in>'
      >>> path_to_mtf_small_mt5_spm_model_path = '<fill_in>'
      >>> t5_model = t5.models.MtfModel(model_dir=path_to_mtf_small_mt5_checkpoint, batch_size=1, tpu=None)
      >>> vocab = SentencePieceVocabulary(path_to_mtf_small_mt5_spm_model_path, extra_ids=100)
      >>> score = t5_model.score(inputs=["Hello there"], targets=["Hi I am"], vocabulary=vocab)
      """
  
      model = TFAutoModelForSeq2SeqLM.from_pretrained(
          "google/mt5-small"
      )
      tokenizer = AutoTokenizer.from_pretrained("google/mt5-small")
  
      input_ids = tokenizer(
          "Hello there", return_tensors="tf"
      ).input_ids
      labels = tokenizer("Hi I am", return_tensors="tf").input_ids
  
      loss = model(input_ids, labels=labels).loss
      mtf_score = -tf.math.reduce_mean(loss).numpy()
  
      EXPECTED_SCORE = -21.228168
      self.assertTrue(abs(mtf_score - EXPECTED_SCORE) < 2e-4)
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/tests/models/mt5/test_modeling_tf_mt5.py
imports: import unittest
  from transformers import is_tf_available
  from transformers.testing_utils import require_sentencepiece, require_tf, require_tokenizers, slow
label_desc: Use image node_id 1 for calling the TFMT5ModelIntegrationTest obj's underlying member method code with example usage: obj.test_small_integration_test() without return types