class_docstr: T5 For RAG.
code: def __init__(self, opt, dictionary, retriever_shared=None):
      opt["t5"] = build_t5(opt)
      if opt["t5_model_parallel"]:
          opt["t5"].parallelize()
      else:
          opt["t5"].deparallelize()
      super().__init__(opt, dictionary, retriever_shared)
      self.embedding_size = opt["t5"].model_dim
      self.t5 = opt.pop("t5", None)
      self.paralleled = not opt["t5_model_parallel"]
  
imports: import torch
  import torch.cuda
  import torch.nn
  import torch.nn.functional
  from typing import Any, Tuple, Dict, Optional, List, Union, Type
  from parlai.agents.hugging_face.t5 import ParlaiT5Encoder, ParlaiT5Decoder, build_t5, set_device
  from parlai.agents.transformer.modules import TransformerEncoder, TransformerDecoder, get_n_positions_from_options, create_embeddings
  from parlai.core.dict import DictionaryAgent
  from parlai.core.opt import Opt
  from parlai.core.torch_generator_agent import TorchGeneratorModel
  from parlai.utils.torch import padded_tensor
  from parlai.agents.rag.retrievers import RagRetriever, retriever_factory, Document
label_desc: Use image node_id 1 to create a new T5RagModel object from inherited base classes: RagModel with example: obj = T5RagModel(opt, dictionary, retriever_shared)