From 8084b6f9a7d9fdb5e077b31ab848539bc5b60f3f Mon Sep 17 00:00:00 2001 From: ebolam Date: Wed, 14 Sep 2022 17:35:32 -0400 Subject: [PATCH] Fix for editing --- koboldai_settings.py | 8 +++++--- static/koboldai.css | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/koboldai_settings.py b/koboldai_settings.py index 48e834bb..b29db50f 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -116,7 +116,7 @@ class koboldai_vars(object): if self.tokenizer is None: used_tokens = 99999999999999999999999 else: - used_tokens = self.sp_length + used_tokens = 0 if self.sp_length is None else self.sp_length text = "" # TODO: We may want to replace the "text" variable with a list-type @@ -222,7 +222,7 @@ class koboldai_vars(object): match=True break if match: - if used_tokens+0 if 'token_length' not in wi else wi['token_length'] <= token_budget: + if used_tokens+0 if 'token_length' not in wi or wi['token_length'] is None else wi['token_length'] <= token_budget: used_tokens+=wi['token_length'] used_world_info.append(wi['uid']) wi_text = wi["content"] @@ -257,7 +257,7 @@ class koboldai_vars(object): match=True break if match: - if used_tokens+0 if 'token_length' not in wi else wi['token_length'] <= token_budget: + if used_tokens+0 if 'token_length' not in wi or wi['token_length'] is None else wi['token_length'] <= token_budget: used_tokens+=wi['token_length'] used_world_info.append(wi['uid']) wi_text = wi["content"] @@ -1477,6 +1477,8 @@ class KoboldWorldInfo(object): for column in ["uid","title","key","keysecondary","folder","constant","content","comment","token_length","selective","used_in_game"]: if column not in self.world_info[item]: self.world_info[item][column] = None + if "wpp" not in self.world_info[item]: + self.world_info[item]['wpp'] = {'name': "", 'type': "", 'format': "W++", 'attributes': {}} try: self.sync_world_info_to_old_format() except: diff --git a/static/koboldai.css b/static/koboldai.css index fc770080..8ac52911 100644 --- a/static/koboldai.css +++ b/static/koboldai.css @@ -1191,7 +1191,7 @@ body { .editing{ border:none; outline:none; - color: var(--text_edit); + color: var(--text_edit) !important; } .gametext span span[title]:not([title=""]) {