def METHOD_NAME(args):
    runtime_option = fastdeploy.RuntimeOption()
    # Set device
    if args.device == 'cpu':
        runtime_option.use_cpu()
        runtime_option.set_cpu_thread_num(args.cpu_num_threads)
    else:
        runtime_option.use_gpu(args.device_id)
    # Set backend
    if args.backend == 'onnx_runtime':
        runtime_option.use_ort_backend()
    elif args.backend == 'paddle_inference':
        runtime_option.use_paddle_infer_backend()
    elif args.backend == 'openvino':
        runtime_option.use_openvino_backend()
    else:
        runtime_option.use_trt_backend()
        if args.backend == 'paddle_tensorrt':
            runtime_option.enable_paddle_to_trt()
            runtime_option.enable_paddle_trt_collect_shape()
        # Only useful for single stage predict
        runtime_option.set_trt_input_shape(
            'input_ids',
            min_shape=[1, 1],
            opt_shape=[args.batch_size, args.max_length // 2],
            max_shape=[args.batch_size, args.max_length])
        runtime_option.set_trt_input_shape(
            'token_type_ids',
            min_shape=[1, 1],
            opt_shape=[args.batch_size, args.max_length // 2],
            max_shape=[args.batch_size, args.max_length])
        runtime_option.set_trt_input_shape(
            'pos_ids',
            min_shape=[1, 1],
            opt_shape=[args.batch_size, args.max_length // 2],
            max_shape=[args.batch_size, args.max_length])
        runtime_option.set_trt_input_shape(
            'att_mask',
            min_shape=[1, 1],
            opt_shape=[args.batch_size, args.max_length // 2],
            max_shape=[args.batch_size, args.max_length])
        trt_file = os.path.join(args.model_dir, "inference.trt")
        if args.use_fp16:
            runtime_option.enable_trt_fp16()
            trt_file = trt_file + ".fp16"
        runtime_option.set_trt_cache_file(trt_file)
    return runtime_option