docstr: For comparision run:
  >>> import t5  # pip install t5==0.9.1
  
  >>> path_to_byt5_small_checkpoint = '<fill_in>'
  >>> t5_model = t5.models.MtfModel(model_dir=path_to_tf_checkpoint, batch_size=1, tpu=None)
  >>> vocab = t5.data.ByteVocabulary()
  >>> score = t5_model.score(inputs=["Hello there"], targets=["Hi I am"], vocabulary=vocab)
docstr_tok: ["For","comparision","run",":",">",">",">","import","t5","#","pip","install","t5==0.9.1",">",">",">","path_to_byt5_small_checkpoint","=","'","<","fill_in",">","'",">",">",">","t5_model","=","t5.models.MtfModel","(","model_dir=path_to_tf_checkpoint",",","batch_size=1",",","tpu=None",")",">",">",">","vocab","=","t5.data.ByteVocabulary","(",")",">",">",">","score","=","t5_model.score","(","inputs=","[","``","Hello","there","''","]",",","targets=","[","``","Hi","I","am","''","]",",","vocabulary=vocab",")"]
code: def test_small_byt5_integration_test(self):
      """
      For comparision run:
      >>> import t5  # pip install t5==0.9.1
  
      >>> path_to_byt5_small_checkpoint = '<fill_in>'
      >>> t5_model = t5.models.MtfModel(model_dir=path_to_tf_checkpoint, batch_size=1, tpu=None)
      >>> vocab = t5.data.ByteVocabulary()
      >>> score = t5_model.score(inputs=["Hello there"], targets=["Hi I am"], vocabulary=vocab)
      """
  
      model = FlaxT5ForConditionalGeneration.from_pretrained(
          "google/byt5-small"
      )
      tokenizer = ByT5Tokenizer.from_pretrained("google/byt5-small")
  
      input_ids = tokenizer(
          "Hello there", return_tensors="np"
      ).input_ids
      labels = tokenizer("Hi I am", return_tensors="np").input_ids
  
      decoder_input_ids = shift_tokens_right(
          labels,
          model.config.pad_token_id,
          model.config.decoder_start_token_id,
      )
  
      logits = model(
          input_ids, decoder_input_ids=decoder_input_ids
      ).logits
      loss = optax.softmax_cross_entropy(
          logits, onehot(labels, logits.shape[-1])
      ).mean()
  
      mtf_score = -(labels.shape[-1] * loss.item())
  
      EXPECTED_SCORE = -60.7397
      self.assertTrue(abs(mtf_score - EXPECTED_SCORE) < 1e-4)
  
imports: import tempfile
  import unittest
  import numpy
  import transformers
  from transformers import is_flax_available
  from transformers.testing_utils import is_pt_flax_cross_test, require_flax, require_sentencepiece, require_tokenizers, slow
  from ...generation.test_generation_flax_utils import FlaxGenerationTesterMixin
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_flax_common import FlaxModelTesterMixin, ids_tensor
label_desc: Use image node_id 3 for calling the FlaxT5ModelIntegrationTests obj's underlying member method code with example usage: obj.test_small_byt5_integration_test() without return types