From a54b91af778ffb89193874a11ede74a0b1b0cd41 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sun, 5 Mar 2023 10:21:15 -0300 Subject: [PATCH] Improve readability --- modules/text_generation.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/text_generation.py b/modules/text_generation.py index 7b6bdcf5..e6207b56 100644 --- a/modules/text_generation.py +++ b/modules/text_generation.py @@ -115,7 +115,6 @@ def generate_reply(question, max_new_tokens, do_sample, temperature, top_p, typi input_ids = encode(question, max_new_tokens) cuda = "" if (shared.args.cpu or shared.args.deepspeed or shared.args.flexgen) else ".cuda()" n = shared.tokenizer.eos_token_id if eos_token is None else encode(eos_token)[0][-1] - if stopping_string is not None: # The stopping_criteria code below was copied from # https://github.com/PygmalionAI/gradio-ui/blob/master/src/model.py @@ -152,14 +151,12 @@ def generate_reply(question, max_new_tokens, do_sample, temperature, top_p, typi f"temperature={temperature}", f"stop={n}", ] - if shared.args.deepspeed: generate_params.append("synced_gpus=True") if shared.args.no_stream: generate_params.append("max_new_tokens=max_new_tokens") else: generate_params.append("max_new_tokens=8") - if shared.soft_prompt: inputs_embeds, filler_input_ids = generate_softprompt_input_tensors(input_ids) generate_params.insert(0, "inputs_embeds=inputs_embeds")