code: def test_mmf_from_params_encoder_factory(self):
      modalities_config = [
          MMFTransformerModalityConfig(
              type="image",
              key="image",
              embedding_dim=256,
              position_dim=1,
              segment_id=0,
              encoder=ImageEncoderFactory.Config(
                  type=ImageEncoderTypes.identity
              ),
          ),
          MMFTransformerModalityConfig(
              type="text",
              key="text",
              embedding_dim=756,
              position_dim=512,
              segment_id=0,
              encoder=TextEncoderFactory.Config(
                  type=TextEncoderTypes.identity
              ),
          ),
      ]
      mmft = MMFTransformer.from_params(
          modalities=modalities_config, num_labels=2
      )
      mmft.build()
  
      config = OmegaConf.structured(
          MMFTransformer.Config(
              modalities=modalities_config, num_labels=2
          )
      )
      self.assertIsNotNone(mmft)
      self.assertEqual(mmft.config, config)
  
imports: import gc
  import unittest
  import tests.test_utils
  import torch
  from mmf.common.sample import SampleList
  from mmf.models.mmf_transformer import MMFTransformer, MMFTransformerModalityConfig
  from mmf.models.transformers.heads.mlm import MLM
  from mmf.modules.encoders import EncoderFactory, IdentityEncoder, ImageEncoderFactory, ImageEncoderTypes, ResNet152ImageEncoder, TextEncoderFactory, TextEncoderTypes
  from mmf.utils.build import build_model
  from mmf.utils.configuration import Configuration
  from mmf.utils.env import setup_imports, teardown_imports
  from omegaconf import OmegaConf
  from tests.test_utils import skip_if_no_pytorchvideo
label_desc: Use image node_id 4 for calling the TestMMFTransformerConfig obj's underlying member method code with example usage: obj.test_mmf_from_params_encoder_factory() without return types