From 285da402a43060ee2726547f7df52390e292cbb5 Mon Sep 17 00:00:00 2001 From: flemingxu Date: Sun, 13 Feb 2022 21:30:26 +0800 Subject: [PATCH] update interact --- examples/interact.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/interact.py b/examples/interact.py index a4b6669..c66a3a5 100644 --- a/examples/interact.py +++ b/examples/interact.py @@ -12,9 +12,9 @@ if __name__ == '__main__': parser = argparse.ArgumentParser(description='Params') parser.add_argument('--model_dir', type=str, default="outputs-fine-tuned", help='the path to load fine-tuned model') - parser.add_argument('--max_length', type=int, default=128, help='maximum length for code generation') - parser.add_argument('--temperature', type=float, default=0.7, help='temperature for sampling-based code generation') - parser.add_argument('--num_return_sequences', type=int, default=3, help='number of sequences to be generated') + parser.add_argument('--max_length', type=int, default=64, help='maximum length for code generation') + parser.add_argument('--temperature', type=float, default=1.0, help='temperature for sampling-based code generation') + parser.add_argument('--num_return_sequences', type=int, default=1, help='number of sequences to be generated') args = parser.parse_args() # load fine-tuned model and tokenizer from path specified by --model_dir @@ -31,5 +31,5 @@ num_return_sequences=args.num_return_sequences) print("Generated code:") for i, code in enumerate(generated_codes): - print("{}. {}".format(i + 1, code)) + print("{}:\n {}".format(i + 1, code)) print("=" * 20)