Author's note length fix

This commit is contained in:
ebolam
2022-08-24 18:33:05 -04:00
parent a9787206b6
commit 64a915ac3e

View File

@@ -571,10 +571,10 @@ class story_settings(settings):
if name == 'tokenizer' and not new_variable:
self.memory_length = len(self.tokenizer.encode(self.memory))
self.prompt_length = len(self.tokenizer.encode(self.prompt))
self.authornote_length = len(self.tokenizer.encode(self.authornotetemplate.replace("<|>", self.authornote)))
self.authornote_length = 0 if self.authornote="" else len(self.tokenizer.encode(self.authornotetemplate.replace("<|>", self.authornote)))
ignore = self.koboldai_vars.calc_ai_text()
elif name == 'authornote' or name == 'authornotetemplate':
self.authornote_length = len(self.tokenizer.encode(self.authornotetemplate.replace("<|>", self.authornote)))
self.authornote_length = 0 if self.authornote="" else len(self.tokenizer.encode(self.authornotetemplate.replace("<|>", self.authornote)))
ignore = self.koboldai_vars.calc_ai_text()
elif name == 'memory':
self.memory_length = len(self.tokenizer.encode(self.memory))