Compare commits

...

2 Commits

Author SHA1 Message Date
henk717 1d41966d88
Merge pull request #129 from VE-FORBRYDERNE/budget
Account for lnheader in budget calculation
2022-06-23 12:39:20 +02:00
vfbd 0eb9f8a879 Account for lnheader in budget calculation 2022-06-22 19:16:24 -04:00
1 changed files with 2 additions and 2 deletions

View File

@ -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.") 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): 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: 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 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 maybe_lnprompt = lnprompt if vars.useprompt and actionlen > 0 else 0