mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Speed up
This commit is contained in:
@@ -133,7 +133,7 @@ class koboldai_vars(object):
|
||||
#Add constant world info entries to memory
|
||||
for wi in self.worldinfo_v2:
|
||||
if wi['constant']:
|
||||
if used_tokens+wi['token_length'] <= token_budget:
|
||||
if used_tokens+0 if 'token_length' not in wi else wi['token_length'] <= token_budget:
|
||||
used_tokens+=wi['token_length']
|
||||
used_world_info.append(wi['uid'])
|
||||
self.worldinfo_v2.set_world_info_used(wi['uid'])
|
||||
@@ -159,7 +159,7 @@ class koboldai_vars(object):
|
||||
match=True
|
||||
break
|
||||
if match:
|
||||
if used_tokens+wi['token_length'] <= token_budget:
|
||||
if used_tokens+0 if 'token_length' not in wi else wi['token_length'] <= token_budget:
|
||||
used_tokens+=wi['token_length']
|
||||
used_world_info.append(wi['uid'])
|
||||
text += wi['content']
|
||||
@@ -236,7 +236,7 @@ class koboldai_vars(object):
|
||||
match=True
|
||||
break
|
||||
if match:
|
||||
if used_tokens+wi['token_length'] <= token_budget:
|
||||
if used_tokens+0 if 'token_length' not in wi else wi['token_length'] <= token_budget:
|
||||
used_tokens+=wi['token_length']
|
||||
used_world_info.append(wi['uid'])
|
||||
text += wi['content']
|
||||
|
@@ -51,6 +51,7 @@ map2.set(3, 'Tail Free Sampling')
|
||||
map2.set(4, 'Typical Sampling')
|
||||
map2.set(5, 'Temperature')
|
||||
var use_word_highlighting = true;
|
||||
var calc_token_usage_timeout;
|
||||
//-----------------------------------Server to UI Functions-----------------------------------------------
|
||||
function connect() {
|
||||
console.log("connected");
|
||||
@@ -1466,7 +1467,8 @@ function world_info_entry(data) {
|
||||
|
||||
update_token_lengths();
|
||||
|
||||
calc_token_usage();
|
||||
clearTimeout(calc_token_usage_timeout);
|
||||
calc_token_usage_timeout = setTimeout(calc_token_usage, 200);
|
||||
return world_info_card;
|
||||
}
|
||||
|
||||
@@ -2451,7 +2453,8 @@ function assign_world_info_to_action(action_item, uid) {
|
||||
}
|
||||
|
||||
function update_token_lengths() {
|
||||
calc_token_usage();
|
||||
clearTimeout(calc_token_usage_timeout);
|
||||
calc_token_usage_timeout = setTimeout(calc_token_usage, 200);
|
||||
return
|
||||
max_token_length = parseInt(document.getElementById("model_max_length_cur").value);
|
||||
included_world_info = [];
|
||||
|
Reference in New Issue
Block a user