mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Fix for token length
This commit is contained in:
@@ -903,11 +903,25 @@ function upload_file(file_box) {
|
|||||||
//--------------------------------------------General UI Functions------------------------------------
|
//--------------------------------------------General UI Functions------------------------------------
|
||||||
function update_token_lengths() {
|
function update_token_lengths() {
|
||||||
max_token_length = parseInt(document.getElementById("model_max_length_cur").value);
|
max_token_length = parseInt(document.getElementById("model_max_length_cur").value);
|
||||||
token_length = 0;
|
if ((document.getElementById("memory").getAttribute("story_memory_length") == null) || (document.getElementById("memory").getAttribute("story_memory_length") == "")) {
|
||||||
token_length += parseInt(document.getElementById("memory").getAttribute("story_memory_length"));
|
memory_length = 0;
|
||||||
token_length += parseInt(document.getElementById("authors_nodes").getAttribute("story_authornote_length"));
|
} else {
|
||||||
always_prompt = document.getElementById("story_useprompt").value == "true";
|
memory_length = parseInt(document.getElementById("memory").getAttribute("story_memory_length"));
|
||||||
|
}
|
||||||
|
if ((document.getElementById("authors_notes").getAttribute("story_authornote_length") == null) || (document.getElementById("authors_notes").getAttribute("story_authornote_length") == "")) {
|
||||||
|
authors_notes = 0;
|
||||||
|
} else {
|
||||||
|
authors_notes = parseInt(document.getElementById("authors_notes").getAttribute("story_authornote_length"));
|
||||||
|
}
|
||||||
|
if ((document.getElementById("story_prompt").getAttribute("story_prompt_length") == null) || (document.getElementById("story_prompt").getAttribute("story_prompt_length") == "")) {
|
||||||
|
prompt_length = 0;
|
||||||
|
} else {
|
||||||
prompt_length = parseInt(document.getElementById("story_prompt").getAttribute("story_prompt_length"));
|
prompt_length = parseInt(document.getElementById("story_prompt").getAttribute("story_prompt_length"));
|
||||||
|
}
|
||||||
|
|
||||||
|
token_length = memory_length + authors_notes;
|
||||||
|
|
||||||
|
always_prompt = document.getElementById("story_useprompt").value == "true";
|
||||||
if (always_prompt) {
|
if (always_prompt) {
|
||||||
token_length += prompt_length
|
token_length += prompt_length
|
||||||
document.getElementById("story_prompt").classList.add("within_max_length");
|
document.getElementById("story_prompt").classList.add("within_max_length");
|
||||||
|
@@ -14,7 +14,7 @@ Status:<hr/>
|
|||||||
<hr/>
|
<hr/>
|
||||||
<div id="author_notes">
|
<div id="author_notes">
|
||||||
Author's Notes:<br/>
|
Author's Notes:<br/>
|
||||||
<textarea rows=5 id="authors_nodes" class="var_sync_story_authornote var_sync_alt_story_authornote_length fullwidth" onblur='socket.emit("var_change", {"ID": "story_authornote", "value": this.value});'></textarea><br/>
|
<textarea rows=5 id="authors_notes" class="var_sync_story_authornote var_sync_alt_story_authornote_length fullwidth" onblur='socket.emit("var_change", {"ID": "story_authornote", "value": this.value});'></textarea><br/>
|
||||||
Template:<br/>
|
Template:<br/>
|
||||||
<input type=text class="var_sync_story_authornotetemplate fullwidth" onblur='socket.emit("var_change", {"ID": "story_authornotetemplate", "value": this.value});'><br/>
|
<input type=text class="var_sync_story_authornotetemplate fullwidth" onblur='socket.emit("var_change", {"ID": "story_authornotetemplate", "value": this.value});'><br/>
|
||||||
andepth<br/>
|
andepth<br/>
|
||||||
|
Reference in New Issue
Block a user