code: def get_multi_t5_tokenize(max_num_tokens, append_eos=True):
      """Tokenizes a text using T5 Tokenizer."""
  
      tokenizer = t5_tokenizer.build_dmvr_sp_model()
      tokenizer.initialize()
      max_answers = 10
  
      def _multi_t5_tokenize(texts):
          parse = functools.partial(
              tokenizer.string_tensor_to_indices,
              max_num_tokens=max_num_tokens,
              append_eos=append_eos,
          )
          # if texts.shape.ndims == 1:
          #   tokens = parse(string_tensor=texts)
          # else:
          #   tokens = tf.map_fn(parse, texts)
          tokens = parse(string_tensor=texts)[:max_answers]
          return tf.cast(tokens, tf.int16)
  
      return _multi_t5_tokenize
  
imports: import functools
  from big_vision.datasets.imagenet import class_names
  import numpy
  from scenic.dataset_lib import dataset_utils
  from scenic.dataset_lib.big_transfer import registry
  from scenic.dataset_lib.big_transfer.preprocessing import utils
  from scenic.projects.t5 import tokenizer
  import tensorflow
label_desc: Use image node_id 5 for calling a global function with example usage: get_multi_t5_tokenize(max_num_tokens, append_eos) and returns: _multi_t5_tokenize, tf