def METHOD_NAME(original_fn, *args, **kwargs):
    if not PatchGradio._current_task:
        return original_fn(*args, **kwargs)
    PatchGradio.__warn_on_server_config(
        kwargs.get("server_name"),
        kwargs.get("server_port"),
        kwargs.get("root_path")
    )
    if not running_remotely():
        return original_fn(*args, **kwargs)
    # noinspection PyProtectedMember
    PatchGradio._current_task._set_runtime_properties(
        {"_SERVICE": "EXTERNAL", "_ADDRESS": get_private_ip(), "_PORT": PatchGradio._default_gradio_port}
    )
    PatchGradio._current_task.set_system_tags(["external_service"])
    kwargs["server_name"] = PatchGradio._default_gradio_address
    kwargs["server_port"] = PatchGradio._default_gradio_port
    kwargs["root_path"] = PatchGradio._root_path_format.format(PatchGradio._current_task.id)
    # noinspection PyBroadException
    try:
        return original_fn(*args, **kwargs)
    except Exception:
        del kwargs["root_path"]
        return original_fn(*args, **kwargs)