code: def predict(
      self,
      test_data: Optional[Union[str, DataFrame]] = None,
      output_dir: str = None,
      saved_model_path: str = None,
  ) -> DataFrame:
      test_set = self._prepare_data(test_data, "test_data")
      if self.trainer is not None:
          trainer = self.trainer
          logger.info("trainer found, skip setting up")
      else:
          if self.is_guest():
              trainer = self.guest_setup(
                  output_dir=output_dir, saved_model=saved_model_path
              )[0]
          else:
              trainer = self.host_setup(
                  output_dir=output_dir, saved_model=saved_model_path
              )[0]
  
      if self.is_guest():
          classes = run_dataset_func(test_set, "get_classes")
          match_ids = run_dataset_func(test_set, "get_match_ids")
          sample_ids = run_dataset_func(test_set, "get_sample_ids")
          match_id_name = run_dataset_func(
              test_set, "get_match_id_name"
          )
          sample_id_name = run_dataset_func(
              test_set, "get_sample_id_name"
          )
  
          pred_rs = trainer.predict(test_set)
  
          rs_df = self.get_nn_output_dataframe(
              self.get_context(),
              pred_rs.predictions,
              pred_rs.label_ids
              if hasattr(pred_rs, "label_ids")
              else None,
              match_ids,
              sample_ids,
              match_id_name=match_id_name,
              sample_id_name=sample_id_name,
              dataframe_format="fate_std",
              task_type=self.task_type,
              classes=classes,
          )
          return rs_df
  
      elif self.is_host():
          trainer.predict(test_set)
  
imports: import logging
  from fate.components.components.nn.loader import Loader
  from typing import Optional, Union, Dict, Literal
  from fate.arch.dataframe import DataFrame
  from fate.components.components.nn.nn_runner import NNRunner, loader_load_from_conf, load_model_dict_from_path, dir_warning, run_dataset_func
  from transformers.trainer_utils import get_last_checkpoint
  from fate.ml.nn.hetero.hetero_nn import HeteroNNTrainerGuest, HeteroNNTrainerHost, TrainingArguments
  from fate.ml.nn.model_zoo.hetero_nn_model import HeteroNNModelGuest, HeteroNNModelHost
  from fate.components.components.utils import consts
  from fate.ml.nn.dataset.table import TableDataset, Dataset
  from fate.ml.nn.model_zoo.hetero_nn_model import FedPassArgument, StdAggLayerArgument, parse_agglayer_conf, TopModelStrategyArguments
label_desc: Use image node_id 8 for calling the DefaultRunner obj's underlying member method code with example usage: obj.predict(test_data, output_dir, saved_model_path) and returns: rs_df