From 0eb9f8a8791173d54cd7592d7101a3d9d123d5de Mon Sep 17 00:00:00 2001 From: vfbd Date: Wed, 22 Jun 2022 19:16:24 -0400 Subject: [PATCH] Account for lnheader in budget calculation --- aiserver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aiserver.py b/aiserver.py index 8779a70a..4081bd79 100644 --- a/aiserver.py +++ b/aiserver.py @@ -3376,9 +3376,9 @@ def calcsubmitbudget(actionlen, winfo, mem, anotetxt, actions, submission=None, raise OverflowError("The author's note in your story is too long. Please either write a shorter author's note or increase the Max Tokens setting. If you are using a soft prompt, additionally consider using a smaller soft prompt.") if(vars.useprompt): - budget = vars.max_length - lnsp - lnprompt - lnmem - lnanote - lnwi - vars.genamt - budget_deduction + budget = vars.max_length - lnheader - lnsp - lnprompt - lnmem - lnanote - lnwi - vars.genamt - budget_deduction else: - budget = vars.max_length - lnsp - lnmem - lnanote - lnwi - vars.genamt - budget_deduction + budget = vars.max_length - lnheader - lnsp - lnmem - lnanote - lnwi - vars.genamt - budget_deduction lnsubmission = len(tokenizer.encode(utils.encodenewlines(vars.comregex_ai.sub('', submission)), max_length=int(2e9), truncation=True)) if submission is not None else 0 maybe_lnprompt = lnprompt if vars.useprompt and actionlen > 0 else 0