def METHOD_NAME(cls, args):
    config = paddle.inference.Config(args.model_path + ".pdmodel", args.model_path + ".pdiparams")
    if args.device == "gpu":
        # set GPU configs accordingly
        config.enable_use_gpu(100, 0)
    elif args.device == "cpu":
        # set CPU configs accordingly,
        # such as enable_mkldnn, set_cpu_math_library_num_threads
        config.disable_gpu()
    elif args.device == "xpu":
        # set XPU configs accordingly
        config.enable_xpu(100)
    config.switch_use_feed_fetch_ops(False)
    predictor = paddle.inference.METHOD_NAME(config)
    input_handles = [predictor.get_input_handle(name) for name in predictor.get_input_names()]
    output_handles = [predictor.get_output_handle(name) for name in predictor.get_output_names()]
    return cls(predictor, input_handles, output_handles)