class_docstr: DecoderOnlyAgent.
  
  Implementation of TorchGeneratorAgent, where the model is a Decoder-Only
  Transformer.
class_docstr_tok: ["DecoderOnlyAgent",".","Implementation","of","TorchGeneratorAgent",",","where","the","model","is","a","Decoder-Only","Transformer","."]
docstr: Override of ``TorchAgent.build_model``.
docstr_tok: ["Override","of","``","TorchAgent.build_model","``","."]
code: def build_model(self, states=None):
      """
      Override of ``TorchAgent.build_model``.
      """
      assert (
          self.opt["n_encoder_layers"] == -1
      ), "Decoder-only model cannot have encoder layers."
      wrapped_class = TransformerGeneratorModel.with_components(
          encoder=PassThroughEncoder, decoder=TransformerDecoderOnly
      )
      return wrapped_class(self.opt, self.dict)
  
file_path: ParlAI/parlai/agents/transformer/decoder.py
imports: from typing import Optional
  from parlai.agents.transformer.transformer import add_common_cmdline_args
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.torch_generator_agent import TorchGeneratorAgent
  from parlai.utils.logging import logging
  from parlai.utils.misc import recursive_getattr
  from parlai.utils.torch import padded_tensor
  from .modules import PassThroughEncoder, TransformerDecoderOnly, TransformerGeneratorModel
label_desc: Use image node_id 2 for calling the DecoderAgent obj's underlying member method code with example usage: obj.build_model(states) and returns: wrapped_class