def METHOD_NAME(self, args, inference_model_dir=None):
    import onnxruntime as ort
    if inference_model_dir is None:
        inference_model_dir = args.inference_model_dir
    model_file = os.path.join(inference_model_dir, "inference.onnx")
    config = ort.SessionOptions()
    if args.use_gpu:
        raise ValueError(
            "onnx inference now only supports cpu! please specify use_gpu false."
        )
    else:
        config.intra_op_num_threads = args.cpu_num_threads
        if args.ir_optim:
            config.graph_optimization_level = ort.GraphOptimizationLevel.ORT_ENABLE_ALL
    predictor = ort.InferenceSession(model_file, sess_options=config)
    return predictor, config