From 9ae063e42b60e1517e69d0c5d494fa611a117504 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Thu, 23 Feb 2023 20:22:47 -0300 Subject: [PATCH] Fix softprompts when deepspeed is active (#112) --- modules/text_generation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/text_generation.py b/modules/text_generation.py index d0204102..02d1210d 100644 --- a/modules/text_generation.py +++ b/modules/text_generation.py @@ -37,7 +37,7 @@ def generate_softprompt_input_tensors(input_ids): inputs_embeds = shared.model.transformer.wte(input_ids) inputs_embeds = torch.cat((shared.soft_prompt_tensor, inputs_embeds), dim=1) filler_input_ids = torch.zeros((1, inputs_embeds.shape[1]), dtype=input_ids.dtype).to(shared.model.device) - filler_input_ids += shared.model.config.bos_token_id # setting dummy input_ids to bos tokens + #filler_input_ids += shared.model.config.bos_token_id # setting dummy input_ids to bos tokens return inputs_embeds, filler_input_ids # Removes empty replies from gpt4chan outputs