def METHOD_NAME():
    args = parse_args()
    paddle.set_device(args.device)
    # frontend
    frontend = get_frontend(
        lang=args.lang,
        phones_dict=args.phones_dict,
        tones_dict=args.tones_dict)
    # am_predictor
    am_predictor = get_predictor(
        model_dir=args.inference_dir,
        model_file=args.am + ".pdmodel",
        params_file=args.am + ".pdiparams",
        device=args.device,
        use_trt=args.use_trt,
        use_mkldnn=args.use_mkldnn,
        cpu_threads=args.cpu_threads,
        precision=args.precision)
    # model: {model_name}_{dataset}
    am_dataset = args.am[args.am.rindex('_') + 1:]
    # voc_predictor
    voc_predictor = get_predictor(
        model_dir=args.inference_dir,
        model_file=args.voc + ".pdmodel",
        params_file=args.voc + ".pdiparams",
        device=args.device,
        use_trt=args.use_trt,
        use_mkldnn=args.use_mkldnn,
        cpu_threads=args.cpu_threads,
        precision=args.precision)
    output_dir = Path(args.output_dir)
    output_dir.mkdir(parents=True, exist_ok=True)
    sentences = get_sentences(text_file=args.text, lang=args.lang)
    merge_sentences = True
    fs = 24000 if am_dataset != 'ljspeech' else 22050
    # warmup
    for utt_id, sentence in sentences[:3]:
        with timer() as t:
            mel = get_am_output(
                input=sentence,
                am_predictor=am_predictor,
                am=args.am,
                frontend=frontend,
                lang=args.lang,
                merge_sentences=merge_sentences,
                speaker_dict=args.speaker_dict,
                spk_id=args.spk_id, )
            wav = get_voc_output(voc_predictor=voc_predictor, input=mel)
        speed = wav.size / t.elapse
        rtf = fs / speed
        print(
            f"{utt_id}, mel: {mel.shape}, wave: {wav.shape}, time: {t.elapse}s, Hz: {speed}, RTF: {rtf}."
        )
    print("warm up done!")
    N = 0
    T = 0
    for utt_id, sentence in sentences:
        with timer() as t:
            mel = get_am_output(
                input=sentence,
                am_predictor=am_predictor,
                am=args.am,
                frontend=frontend,
                lang=args.lang,
                merge_sentences=merge_sentences,
                speaker_dict=args.speaker_dict,
                spk_id=args.spk_id, )
            wav = get_voc_output(voc_predictor=voc_predictor, input=mel)
        N += wav.size
        T += t.elapse
        speed = wav.size / t.elapse
        rtf = fs / speed
        sf.write(output_dir / (utt_id + ".wav"), wav, samplerate=fs)
        print(
            f"{utt_id}, mel: {mel.shape}, wave: {wav.shape}, time: {t.elapse}s, Hz: {speed}, RTF: {rtf}."
        )
        print(f"{utt_id} done!")
    print(f"generation speed: {N / T}Hz, RTF: {fs / (N / T) }")