def METHOD_NAME(original, self, *args, **kwargs):
    run_id = mlflow.active_run().info.run_id
    tracking_uri = mlflow.get_tracking_uri()
    client = MlflowAutologgingQueueingClient(tracking_uri)
    metrics_logger = BatchMetricsLogger(run_id, tracking_uri)
    log_models = get_autologging_config(mlflow.paddle.FLAVOR_NAME, "log_models", True)
    log_every_n_epoch = get_autologging_config(mlflow.paddle.FLAVOR_NAME, "log_every_n_epoch", 1)
    early_stop_callback = None
    mlflow_callback = __MLflowPaddleCallback(
        client, metrics_logger, run_id, log_models, log_every_n_epoch
    )
    if "callbacks" in kwargs:
        callbacks = kwargs["callbacks"]
        for callback in callbacks:
            if isinstance(callback, paddle.callbacks.EarlyStopping):
                early_stop_callback = callback
                _log_early_stop_params(early_stop_callback, client, run_id)
                break
        kwargs["callbacks"].append(mlflow_callback)
    else:
        kwargs["callbacks"] = [mlflow_callback]
    client.flush(synchronous=False)
    result = original(self, *args, **kwargs)
    if early_stop_callback is not None:
        _log_early_stop_metrics(early_stop_callback, client, run_id)
    mlflow.log_text(str(self.summary()), "model_summary.txt")
    if log_models:
        registered_model_name = get_autologging_config(
            mlflow.paddle.FLAVOR_NAME, "registered_model_name", None
        )
        mlflow.paddle.log_model(
            pd_model=self, artifact_path="model", registered_model_name=registered_model_name
        )
    client.flush(synchronous=True)
    return result