class_docstr: T5 using HuggingFace Transformers and Keras.
  
  This version supports embeddings, attention, and force-decoding of the target
  text, as well as more options to control decoding (such as beam search).
code: def __init__(
      self,
      model_name_or_path="t5-small",
      model=None,
      tokenizer=None,
      **config_kw,
  ):
      super().__init__()
      # Normally path is a directory; if it's an archive file, download and
      # extract to the transformers cache.
      if model_name_or_path.endswith(".tar.gz"):
          model_name_or_path = file_cache.cached_path(
              model_name_or_path, extract_compressed_file=True
          )
  
      self.config = T5ModelConfig(**config_kw)
      assert self.config.num_to_generate <= self.config.beam_size
      self.tokenizer = (
          tokenizer
          or transformers.T5Tokenizer.from_pretrained(
              model_name_or_path
          )
      )
      self.model = model or model_utils.load_pretrained(
          transformers.TFT5ForConditionalGeneration,
          model_name_or_path,
          output_hidden_states=True,
          output_attentions=self.config.output_attention,
      )
  
imports: import re
  import attr
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.examples.models import model_utils
  from lit_nlp.lib import file_cache
  from lit_nlp.lib import utils
  import tensorflow
  import tensorflow_text
  import transformers
  from rouge_score import rouge_scorer
label_desc: Use image node_id 2 to create a new T5HFModel object from inherited base classes: lit_model with example: obj = T5HFModel(model_name_or_path, model, tokenizer)