From f0050efe638f052b9946f661a71e1560b08eb4cf Mon Sep 17 00:00:00 2001 From: Peter Date: Wed, 6 Sep 2023 08:04:36 -0700 Subject: [PATCH 1/2] remove unused args --- tools/run_text_generation_server.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/tools/run_text_generation_server.py b/tools/run_text_generation_server.py index 52789155b1..c311ac4705 100644 --- a/tools/run_text_generation_server.py +++ b/tools/run_text_generation_server.py @@ -29,23 +29,9 @@ def model_provider(pre_process=True, post_process=True): return model -def add_text_generate_args(parser): - group = parser.add_argument_group(title='text generation') - - group.add_argument("--temperature", type=float, default=1.0, - help='Sampling temperature.') - group.add_argument("--top_p", type=float, default=0.0, - help='Top p sampling.') - group.add_argument("--top_k", type=int, default=0, - help='Top k sampling.') - group.add_argument("--out-seq-length", type=int, default=1024, - help='Size of the output generated text.') - return parser - if __name__ == "__main__": - initialize_megatron(extra_args_provider=add_text_generate_args, - args_defaults={'tokenizer_type': 'GPT2BPETokenizer', + initialize_megatron(args_defaults={'tokenizer_type': 'GPT2BPETokenizer', 'no_load_rng': True, 'no_load_optim': True}) From d6d29b8ee2000d83d88d3079b12ac94b44e09d01 Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 12 Sep 2023 15:47:56 -0700 Subject: [PATCH 2/2] fix merge conflicts --- tools/run_text_generation_server.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/run_text_generation_server.py b/tools/run_text_generation_server.py index de18471493..44e755b859 100644 --- a/tools/run_text_generation_server.py +++ b/tools/run_text_generation_server.py @@ -30,8 +30,16 @@ def model_provider(pre_process=True, post_process=True): return model +def add_text_generate_args(parser): + group = parser.add_argument_group(title='text generation') + group.add_argument("--port", type=int, default=5000, + help='port for text generation server to run on') + return parser + + if __name__ == "__main__": - initialize_megatron(args_defaults={'tokenizer_type': 'GPT2BPETokenizer', + initialize_megatron(extra_args_provider=add_text_generate_args, + args_defaults={'tokenizer_type': 'GPT2BPETokenizer', 'no_load_rng': True, 'no_load_optim': True})