def METHOD_NAME(self, predict_dataset, 
            predict_examples, 
            ignore_keys=None, 
            metric_key_prefix: str = "test",
            **gen_kwargs):
    gen_kwargs = gen_kwargs.copy()
    gen_kwargs["max_length"] = (
        gen_kwargs["max_length"] if gen_kwargs.get("max_length") is not None else self.args.generation_max_length
    )
    gen_kwargs["num_beams"] = (
        gen_kwargs["num_beams"] if gen_kwargs.get("num_beams") is not None else self.args.generation_num_beams
    )
    self._gen_kwargs = gen_kwargs
    predict_dataloader = self.get_test_dataloader(predict_dataset)
    # Temporarily disable metric computation, we will do it in the loop here.
    self.compute_metrics = None
    eval_loop = self.prediction_loop if self.args.use_legacy_prediction_loop else self.evaluation_loop
    try:
        output = eval_loop(
            predict_dataloader,
            description="Prediction",
            # No point gathering the predictions if there are no metrics, otherwise we defer to
            # self.args.prediction_loss_only
            prediction_loss_only=False,
            ignore_keys=ignore_keys,
        )
    finally:
        pass
    if self.post_process_function is not None:
        predictions = self.post_process_function(predict_examples, predict_dataset, output)
    else:
        predictions = {}
    return prediction