class_docstr: Illustrates swapping out components based on command line args.
  
  Specifically, swaps out the decoder ffn between two options.
class_docstr_tok: ["Illustrates","swapping","out","components","based","on","command","line","args",".","Specifically",",","swaps","out","the","decoder","ffn","between","two","options","."]
code: def build_model(self, states=None):
      decoder_variant: DecoderFeedForwardVariant = self.opt[
          "decoder_ffn_variants"
      ]
      if decoder_variant == DecoderFeedForwardVariant.ONE:
          decoder_ffn_class = DecoderFFNOne
      elif decoder_variant == DecoderFeedForwardVariant.TWO:
          decoder_ffn_class = DecoderFFNTwo
      else:
          logging.error(
              "Invalid --decoder-ffn-variants option, defaulting to original ffn implementation."
          )
          decoder_ffn_class = TransformerFFN
  
      wrapped_class = TransformerGeneratorModel.with_components(
          decoder=TransformerDecoder.with_components(
              layer=TransformerDecoderLayer.with_components(
                  feedforward=decoder_ffn_class
              )
          )
      )
      return wrapped_class(opt=self.opt, dictionary=self.dict)
  
imports: from __future__ import annotations
  import torch
  from enum import Enum
  from typing import Dict, Optional, Tuple, Union
  from parlai.agents.transformer.modules import TransformerFFN, MultiHeadAttention, TransformerDecoder, TransformerDecoderLayer, TransformerEncoder, TransformerEncoderLayer, TransformerGeneratorModel
  from parlai.agents.transformer.transformer import TransformerGeneratorAgent
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  import parlai.utils.logging
label_desc: Use image node_id 2 for calling the ConfigurableTransformerAgent obj's underlying member method code with example usage: obj.build_model(states) and returns: wrapped_class