From bf7fc348c6d8bf4394ebab44ab0a79974dca00a2 Mon Sep 17 00:00:00 2001 From: ebolam Date: Fri, 2 Sep 2022 13:53:24 -0400 Subject: [PATCH] Fix for soft prompts --- koboldai_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koboldai_settings.py b/koboldai_settings.py index 8a5f4b52..8d13528a 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -109,7 +109,7 @@ class koboldai_vars(object): # TODO: We may want to replace the "text" variable with a list-type # class of context blocks, the class having a __str__ function. - if self.sp: + if self.sp_length > 0: context.append({"type": "soft_prompt", "text": f"<{self.sp_length} tokens of Soft Prompt.>"}) # Header is never used? # if koboldai_vars.model not in ("Colab", "API", "OAI") and self.tokenizer._koboldai_header: