def METHOD_NAME(args):
    place = paddle.set_device("gpu")
    exe = paddle.static.Executor(place)
    label2id, id2label = load_dict(args.label_path)
    datasets = load_dataset("text", data_files={"dev": args.dev_path})
    tokenizer = PPMiniLMTokenizer.from_pretrained(args.base_model_name)
    trans_func = partial(
        convert_example_to_feature, tokenizer=tokenizer, label2id=label2id, max_seq_len=args.max_seq_len
    )
    dev_ds = datasets["dev"].map(trans_func, batched=False, remove_columns=["text"])
    def batch_generator_func():
        batch_data = [[], []]
        for data in dev_ds:
            batch_data[0].append(data["input_ids"])
            batch_data[1].append(data["token_type_ids"])
            if len(batch_data[0]) == args.batch_size:
                input_ids = Pad(axis=0, pad_val=0, dtype="int64")(batch_data[0])
                segment_ids = Pad(axis=0, pad_val=0, dtype="int64")(batch_data[1])
                yield [input_ids, segment_ids]
                batch_data = [[], []]
    paddleslim.quant.quant_post_static(
        exe,
        args.static_model_dir,
        args.quant_model_dir,
        save_model_filename=args.save_model_filename,
        save_params_filename=args.save_params_filename,
        algo=args.algorithm,
        hist_percent=0.9999,
        batch_generator=batch_generator_func,
        model_filename=args.input_model_filename,
        params_filename=args.input_param_filename,
        quantizable_op_type=["matmul", "matmul_v2"],
        weight_bits=8,
        weight_quantize_type="channel_wise_abs_max",
        batch_nums=1,
    )