def METHOD_NAME(args):
    tokenizer = TOKENIZER_CLASSES[args.model_type].from_pretrained(
        args.tokenizer_name, do_lower_case=args.do_lower_case, 
        cache_dir=args.cache_dir if args.cache_dir else None)
    eos_token = tokenizer.sep_token
    pad_token = tokenizer.pad_token
    eos_id, pad_id = tokenizer.convert_tokens_to_ids([eos_token, pad_token])
    logger.info("*********************************************")
    logger.info(" EOS TOKEN = {}, ID = {}".format(eos_token, eos_id))
    logger.info(" PAD TOKEN = {}, ID = {}".format(pad_token, pad_id))
    logger.info("*********************************************")
    for input_file in tqdm(glob.glob(args.input)):
        if not Path(input_file+'.trace.pickle').exists():
            continue
        print(input_file)
        samples = read_traces_from_file(input_file+'.trace.pickle')
        results = []
        for s in samples:
            word_ids = get_best_sequence(s, eos_id, pad_id, alpha=args.alpha,
                                         length_penalty=args.length_penalty, expect=args.expect, min_len=args.min_len)
            tokens = tokenizer.convert_ids_to_tokens(word_ids)
            buf = []
            for t in tokens:
                if t in (eos_token, pad_token):
                    break
                else:
                    buf.append(t)
            if args.model_type == "roberta" or args.model_type == "xlm-roberta":
                output_text = " ".join(simple_postprocess(tokenizer.convert_tokens_to_string(buf).split(' ')))
                if '\n' in output_text:
                    output_text = " [X_SEP] ".join(output_text.split('\n'))
            else:
                output_text = " ".join(simple_postprocess(detokenize(buf)))
            results.append(output_text)
        fn_out = input_file + '.'
        if args.length_penalty:
            fn_out += 'lenp'+str(args.length_penalty)
        if args.expect:
            fn_out += 'exp'+str(args.expect)
        if args.alpha:
            fn_out += 'alp'+str(args.alpha)
        if args.min_len:
            fn_out += 'minl'+str(args.min_len)
        with open(fn_out, "w", encoding="utf-8") as fout:
            for line in results:
                fout.write(line)
                fout.write("\n")
        logger.info("Output file = [%s]" % fn_out)