Remove comments from prompt in WI processor and InferKit mode

This commit is contained in:
Gnome Ann 2021-11-20 22:23:06 -05:00
parent 8ce8e621ce
commit 1968be82bb

View File

@ -1391,12 +1391,12 @@ def calcsubmit(txt):
forceanote = True forceanote = True
if(vars.useprompt): if(vars.useprompt):
budget = vars.ikmax - len(vars.prompt) - len(anotetxt) - len(mem) - len(winfo) - 1 budget = vars.ikmax - len(vars.comregex_ai.sub('', vars.prompt)) - len(anotetxt) - len(mem) - len(winfo) - 1
else: else:
budget = vars.ikmax - len(anotetxt) - len(mem) - len(winfo) - 1 budget = vars.ikmax - len(anotetxt) - len(mem) - len(winfo) - 1
subtxt = "" subtxt = ""
prompt = vars.prompt prompt = vars.comregex_ai.sub('', vars.prompt)
n = 0 n = 0
for key in reversed(vars.actions): for key in reversed(vars.actions):
chunk = vars.actions[key] chunk = vars.actions[key]
@ -1417,7 +1417,7 @@ def calcsubmit(txt):
# add some prompt. # add some prompt.
if(not vars.useprompt): if(not vars.useprompt):
if(budget > 0): if(budget > 0):
prompt = vars.prompt[-budget:] prompt = vars.comregex_ai.sub('', vars.prompt)[-budget:]
else: else:
prompt = "" prompt = ""
@ -2092,9 +2092,9 @@ def checkworldinfo(txt, force_use_txt=False):
if(ln >= depth): if(ln >= depth):
txt = "".join(chunks) txt = "".join(chunks)
elif(ln > 0): elif(ln > 0):
txt = vars.prompt + "".join(chunks) txt = vars.comregex_ai.sub('', vars.prompt) + "".join(chunks)
elif(ln == 0): elif(ln == 0):
txt = vars.prompt txt = vars.comregex_ai.sub('', vars.prompt)
if(force_use_txt): if(force_use_txt):
txt += original_txt txt += original_txt