class_docstr: Test of T5 model.
class_docstr_tok: ["Test","of","T5","model","."]
docstr: From Huggingface.
docstr_tok: ["From","Huggingface","."]
code: def test_small(self):
      """
      From Huggingface.
      """
      opt = ParlaiParser(True, True).parse_args(
          [
              "--model",
              "hugging_face/t5",
              "--t5-model-arch",
              "t5-small",
              "--no-cuda",
          ]
      )
      agent_small = create_agent(opt)
      text_vec = torch.LongTensor(
          agent_small.dict.txt2vec("Hello there")
      ).unsqueeze(0)
      label_vec = torch.LongTensor(
          agent_small.dict.txt2vec("Hi I am")
      ).unsqueeze(0)
  
      score = -agent_small.compute_loss(
          Batch(text_vec=text_vec, label_vec=label_vec)
      ) * label_vec.size(1)
      EXPECTED_SCORE = -19.0845
      self.assertAlmostEqual(score.item(), EXPECTED_SCORE, places=3)
  
imports: import os
  import torch
  import unittest
  from parlai.core.agents import create_agent
  from parlai.core.params import ParlaiParser
  from parlai.core.torch_agent import Batch
  import parlai.utils.testing
  from parlai.utils.torch import padded_tensor
  from parlai.utils.testing import tempdir
  from tests.test_distributed import _AbstractTest
label_desc: Use image node_id 3 for calling the TestT5Model obj's underlying member method code with example usage: obj.test_small() without return types