code: def setup_method(self, test_method):
      trainer_config = {
          "devices": 1,
          "num_nodes": 1,
          "accelerator": "gpu",
          "logger": False,
          "precision": 16,
      }
      tensor_model_parallel_size = 1
      pipeline_model_parallel_size = 1
      model_file = (
          "/home/TestData/nlp/megatron_gpt/125M/megatron_gpt.nemo"
      )
  
      # trainer required for restoring model parallel models
      trainer = Trainer(strategy=NLPDDPStrategy(), **trainer_config)
      assert (
          trainer_config["devices"] * trainer_config["num_nodes"]
          == tensor_model_parallel_size * pipeline_model_parallel_size
      ), "devices * num_nodes should equal tensor_model_parallel_size * pipeline_model_parallel_size"
  
      model = MegatronGPTModel.restore_from(
          restore_path=model_file, trainer=trainer
      )
      model.freeze()
  
      # has to turn off activations_checkpoint_method for inference
      try:
          model.model.language_model.encoder.activations_checkpoint_method = (
              None
          )
      except AttributeError:
          pass
  
      self.model = model
  
file_path: NeMo/tests/collections/nlp/test_gpt_eval.py
imports: import os
  import numpy
  import pytest
  from pytorch_lightning.trainer.trainer import Trainer
  from nemo.collections.nlp.models.language_modeling.megatron_gpt_model import MegatronGPTModel
  from nemo.collections.nlp.modules.common.transformer.text_generation import LengthParam, SamplingParam
  from nemo.collections.nlp.parts.nlp_overrides import NLPDDPStrategy
label_desc: Use image node_id 1 for calling the TestGPTEval obj's underlying member method code with example usage: obj.setup_method(test_method) without return types