code: def test_load_resume_zoo_parity_with_mmf(self):
      # not specifying checkpoint.resume, but specifying
      # checkpoint.resume_zoo. It should load the model file
      # underlying zoo
      resume_zoo = "unimodal_text.hateful_memes.bert"
      ckpt_filepath = download_pretrained_model(resume_zoo)
      ckpt_filepath = get_ckpt_path_from_folder(ckpt_filepath)
      ckpt = torch.load(ckpt_filepath, map_location="cpu")
  
      ckpt_config = {
          "resume_zoo": resume_zoo,
          "zoo_config_override": True,
      }
  
      with mock_env_with_temp("mmf.utils.checkpoint.get_mmf_env") as _:
          mmf_trainer = self._get_mmf_trainer(
              ckpt_config=ckpt_config,
              model_config=unimodal_text_model_config,
              max_updates=0,
          )
          mmf_trainer.on_init_start()
          mmf_ckpt = mmf_trainer.model.state_dict()
          mmf_ckpt.pop("base.encoder.embeddings.position_ids")
          self._assert_same_dict(ckpt, mmf_ckpt)
  
      with mock_env_with_temp(
          "mmf.trainers.lightning_trainer.get_mmf_env"
      ) as _:
          # lightning load from zoo, in this case, the zoo ckpt is in mmf format
          lightning = self._get_lightning_trainer(
              ckpt_config=ckpt_config,
              model_config=unimodal_text_model_config,
              max_steps=0,
              seed=4,
          )
          lightning.trainer.fit(
              lightning.model, train_dataloaders=lightning.train_loader
          )
          lightning_ckpt = lightning.model.state_dict()
          lightning_ckpt.pop("base.encoder.embeddings.position_ids")
          self._assert_same_dict(ckpt, lightning_ckpt)
  
imports: import contextlib
  import os
  import tempfile
  import unittest
  from unittest.mock import patch
  import torch
  from mmf.trainers.callbacks.checkpoint import CheckpointCallback
  from mmf.trainers.callbacks.early_stopping import EarlyStoppingCallback
  from mmf.trainers.lightning_core.loop_callback import LightningLoopCallback
  from mmf.utils.checkpoint import get_ckpt_path_from_folder
  from mmf.utils.download import download_pretrained_model
  from tests.test_utils import skip_if_no_network
  from tests.trainers.test_utils import get_config_with_defaults, get_lightning_trainer, get_mmf_trainer, prepare_lightning_trainer
label_desc: Use image node_id 4 for calling the TestLightningCheckpoint obj's underlying member method code with example usage: obj.test_load_resume_zoo_parity_with_mmf() without return types