def METHOD_NAME(config):
    if config.model.init_model_params is None:
        raise RuntimeError("config.init_model_params should be a valid model path")
    dataset_config = {
        "db_file": config.data.db,
        "input_encoder": g_input_encoder,
        "label_encoder": g_label_encoder,
        "is_cached": True,
    }
    test_set = DatasetClass(name="test", data_file=config.data.test_set, **dataset_config)
    test_reader = DataLoaderClass(config, test_set, batch_size=1, shuffle=False)
    model = ModelClass(config.model, g_label_encoder)
    logging.info("loading model param from %s", config.model.init_model_params)
    state_dict = paddle.load(config.model.init_model_params)
    model.set_state_dict(state_dict)
    logging.info("start of inference...")
    launch.infer.METHOD_NAME(
        model, test_reader, config.data.output, beam_size=config.general.beam_size, model_name=config.model.model_name
    )
    logging.info("end of inference...")