def METHOD_NAME(args):
    place = "gpu"
    place = paddle.set_device(place)
    model_name_or_path = args.model_name_or_path
    model = PegasusForConditionalGeneration.from_pretrained(model_name_or_path)
    tokenizer = PegasusChineseTokenizer.from_pretrained(model_name_or_path)
    pegasus = FasterPegasus(model=model, use_fp16_decoding=args.use_fp16_decoding, trans_out=True)
    # Set evaluate mode
    pegasus.eval()
    # Convert dygraph model to static graph model
    pegasus = paddle.jit.to_static(
        pegasus,
        input_spec=[
            # input_ids
            paddle.static.InputSpec(shape=[None, None], dtype="int32"),
            # encoder_output
            None,
            # seq_len
            None,
            # min_length
            args.min_out_len,
            # max_length
            args.max_out_len,
            # num_beams. Used for beam_search.
            args.num_beams,
            # decoding_strategy
            args.decoding_strategy,
            # decoder_start_token_id
            model.decoder_start_token_id,
            # bos_token_id
            tokenizer.bos_token_id,
            # eos_token_id
            tokenizer.eos_token_id,
            # pad_token_id
            tokenizer.pad_token_id,
            # diversity rate. Used for beam search.
            args.diversity_rate,
            # length_penalty
            args.length_penalty,
            # topk
            args.topk,
            # topp
            args.topp,
            # temperature
            args.temperature,
            # num_return_sequences
            args.num_return_sequences,
        ],
    )
    # Save converted static graph model
    paddle.jit.save(pegasus, os.path.join(args.export_output_dir, "pegasus"))
    logger.info("PEGASUS has been saved to {}.".format(args.export_output_dir))