mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Fix for editing
This commit is contained in:
@@ -116,7 +116,7 @@ class koboldai_vars(object):
|
|||||||
if self.tokenizer is None:
|
if self.tokenizer is None:
|
||||||
used_tokens = 99999999999999999999999
|
used_tokens = 99999999999999999999999
|
||||||
else:
|
else:
|
||||||
used_tokens = self.sp_length
|
used_tokens = 0 if self.sp_length is None else self.sp_length
|
||||||
text = ""
|
text = ""
|
||||||
|
|
||||||
# TODO: We may want to replace the "text" variable with a list-type
|
# TODO: We may want to replace the "text" variable with a list-type
|
||||||
@@ -222,7 +222,7 @@ class koboldai_vars(object):
|
|||||||
match=True
|
match=True
|
||||||
break
|
break
|
||||||
if match:
|
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_tokens+=wi['token_length']
|
||||||
used_world_info.append(wi['uid'])
|
used_world_info.append(wi['uid'])
|
||||||
wi_text = wi["content"]
|
wi_text = wi["content"]
|
||||||
@@ -257,7 +257,7 @@ class koboldai_vars(object):
|
|||||||
match=True
|
match=True
|
||||||
break
|
break
|
||||||
if match:
|
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_tokens+=wi['token_length']
|
||||||
used_world_info.append(wi['uid'])
|
used_world_info.append(wi['uid'])
|
||||||
wi_text = wi["content"]
|
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"]:
|
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]:
|
if column not in self.world_info[item]:
|
||||||
self.world_info[item][column] = None
|
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:
|
try:
|
||||||
self.sync_world_info_to_old_format()
|
self.sync_world_info_to_old_format()
|
||||||
except:
|
except:
|
||||||
|
@@ -1191,7 +1191,7 @@ body {
|
|||||||
.editing{
|
.editing{
|
||||||
border:none;
|
border:none;
|
||||||
outline:none;
|
outline:none;
|
||||||
color: var(--text_edit);
|
color: var(--text_edit) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gametext span span[title]:not([title=""]) {
|
.gametext span span[title]:not([title=""]) {
|
||||||
|
Reference in New Issue
Block a user