mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-14 02:49:41 +00:00
updated lite
This commit is contained in:
parent
e35c6b8f9b
commit
268b6f76df
1 changed files with 141 additions and 148 deletions
29
klite.embd
29
klite.embd
|
@ -3368,7 +3368,6 @@ Current version indicated by LITEVER below.
|
||||||
render_streaming_markdown: true,
|
render_streaming_markdown: true,
|
||||||
raw_instruct_tags: false, //experimental flag
|
raw_instruct_tags: false, //experimental flag
|
||||||
show_endpoint_selector: false,
|
show_endpoint_selector: false,
|
||||||
never_rewind_ctx: false,
|
|
||||||
|
|
||||||
//section migrated from story itself
|
//section migrated from story itself
|
||||||
extrastopseq: "",
|
extrastopseq: "",
|
||||||
|
@ -12468,7 +12467,6 @@ Current version indicated by LITEVER below.
|
||||||
document.getElementById("instruct_endtag_end").value = localsettings.instruct_endtag_end;
|
document.getElementById("instruct_endtag_end").value = localsettings.instruct_endtag_end;
|
||||||
document.getElementById("raw_instruct_tags").checked = localsettings.raw_instruct_tags;
|
document.getElementById("raw_instruct_tags").checked = localsettings.raw_instruct_tags;
|
||||||
document.getElementById("show_endpoint_selector").checked = localsettings.show_endpoint_selector;
|
document.getElementById("show_endpoint_selector").checked = localsettings.show_endpoint_selector;
|
||||||
document.getElementById("never_rewind_ctx").checked = localsettings.never_rewind_ctx;
|
|
||||||
document.getElementById("render_streaming_markdown").checked = localsettings.render_streaming_markdown;
|
document.getElementById("render_streaming_markdown").checked = localsettings.render_streaming_markdown;
|
||||||
document.getElementById("min_p").value = localsettings.min_p;
|
document.getElementById("min_p").value = localsettings.min_p;
|
||||||
document.getElementById("dynatemp_range").value = localsettings.dynatemp_range;
|
document.getElementById("dynatemp_range").value = localsettings.dynatemp_range;
|
||||||
|
@ -12997,7 +12995,6 @@ Current version indicated by LITEVER below.
|
||||||
localsettings.persist_session = (document.getElementById("persist_session").checked ? true : false);
|
localsettings.persist_session = (document.getElementById("persist_session").checked ? true : false);
|
||||||
localsettings.raw_instruct_tags = (document.getElementById("raw_instruct_tags").checked ? true : false);
|
localsettings.raw_instruct_tags = (document.getElementById("raw_instruct_tags").checked ? true : false);
|
||||||
localsettings.show_endpoint_selector = (document.getElementById("show_endpoint_selector").checked ? true : false);
|
localsettings.show_endpoint_selector = (document.getElementById("show_endpoint_selector").checked ? true : false);
|
||||||
localsettings.never_rewind_ctx = (document.getElementById("never_rewind_ctx").checked ? true : false);
|
|
||||||
localsettings.render_streaming_markdown = (document.getElementById("render_streaming_markdown").checked ? true : false);
|
localsettings.render_streaming_markdown = (document.getElementById("render_streaming_markdown").checked ? true : false);
|
||||||
if(document.getElementById("opmode").value==1)
|
if(document.getElementById("opmode").value==1)
|
||||||
{
|
{
|
||||||
|
@ -13951,7 +13948,7 @@ Current version indicated by LITEVER below.
|
||||||
input = input.replace(/</g, "");
|
input = input.replace(/</g, "");
|
||||||
input = input.replace(/(?:javascript|vbscript|file):/gi, "");
|
input = input.replace(/(?:javascript|vbscript|file):/gi, "");
|
||||||
//remove all data elements that aren't jpg, png, gif, webp;base64
|
//remove all data elements that aren't jpg, png, gif, webp;base64
|
||||||
input = input.replace(/data:(?!image\/(jpeg|png|gif|webp);base64,)[^)'";\s]*/gi, "");
|
input = input.replace(/data:(?!image\/(jpeg|jpg|png|gif|webp);base64,)[^;\s]*(?:;[^,\s]*)*(?:,[^)\s'"]*)?/gi, "");
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
function apply_custom_css()
|
function apply_custom_css()
|
||||||
|
@ -15384,7 +15381,7 @@ Current version indicated by LITEVER below.
|
||||||
//if there is no memory, then we can be a lot of lenient with the character counts since the backend will truncate excess anyway
|
//if there is no memory, then we can be a lot of lenient with the character counts since the backend will truncate excess anyway
|
||||||
chars_per_token = 4.8;
|
chars_per_token = 4.8;
|
||||||
}
|
}
|
||||||
if (is_using_kcpp_with_added_memory() && !localsettings.never_rewind_ctx) //easily handle overflow
|
if (is_using_kcpp_with_added_memory()) //easily handle overflow
|
||||||
{
|
{
|
||||||
chars_per_token = 6;
|
chars_per_token = 6;
|
||||||
}
|
}
|
||||||
|
@ -16061,7 +16058,7 @@ Current version indicated by LITEVER below.
|
||||||
{
|
{
|
||||||
truncated_memory = replace_placeholders(truncated_memory,false,false,true);
|
truncated_memory = replace_placeholders(truncated_memory,false,false,true);
|
||||||
truncated_anote = replace_placeholders(truncated_anote,false,false,false);
|
truncated_anote = replace_placeholders(truncated_anote,false,false,false);
|
||||||
if(!is_using_kcpp_with_added_memory() || localsettings.never_rewind_ctx)
|
if(!is_using_kcpp_with_added_memory())
|
||||||
{
|
{
|
||||||
let augmented_len = truncated_memory.length + truncated_context.length + truncated_anote.length;
|
let augmented_len = truncated_memory.length + truncated_context.length + truncated_anote.length;
|
||||||
let excess_len = augmented_len - max_allowed_characters; //if > 0, then we exceeded context window
|
let excess_len = augmented_len - max_allowed_characters; //if > 0, then we exceeded context window
|
||||||
|
@ -16088,7 +16085,7 @@ Current version indicated by LITEVER below.
|
||||||
}
|
}
|
||||||
anote_insert_idx = clamp(anote_insert_idx, 0, truncated_context.length);
|
anote_insert_idx = clamp(anote_insert_idx, 0, truncated_context.length);
|
||||||
truncated_context = truncated_context.slice(0, anote_insert_idx) + truncated_anote + truncated_context.slice(anote_insert_idx);
|
truncated_context = truncated_context.slice(0, anote_insert_idx) + truncated_anote + truncated_context.slice(anote_insert_idx);
|
||||||
if(!is_using_kcpp_with_added_memory() || localsettings.never_rewind_ctx)
|
if(!is_using_kcpp_with_added_memory())
|
||||||
{
|
{
|
||||||
truncated_context = truncated_memory + truncated_context;
|
truncated_context = truncated_memory + truncated_context;
|
||||||
}
|
}
|
||||||
|
@ -16096,7 +16093,7 @@ Current version indicated by LITEVER below.
|
||||||
|
|
||||||
truncated_context = replace_placeholders(truncated_context,false,false,true);
|
truncated_context = replace_placeholders(truncated_context,false,false,true);
|
||||||
|
|
||||||
if(is_using_kcpp_with_added_memory() && !localsettings.never_rewind_ctx)
|
if(is_using_kcpp_with_added_memory())
|
||||||
{
|
{
|
||||||
last_token_budget = (truncated_memory.length + truncated_context.length) + "/" + max_allowed_characters;
|
last_token_budget = (truncated_memory.length + truncated_context.length) + "/" + max_allowed_characters;
|
||||||
}
|
}
|
||||||
|
@ -16126,7 +16123,7 @@ Current version indicated by LITEVER below.
|
||||||
"models": selected_models.map((m) => { return m.name }),
|
"models": selected_models.map((m) => { return m.name }),
|
||||||
};
|
};
|
||||||
|
|
||||||
if(is_using_kcpp_with_added_memory() && !localsettings.never_rewind_ctx)
|
if(is_using_kcpp_with_added_memory())
|
||||||
{
|
{
|
||||||
submit_payload.params.memory = truncated_memory;
|
submit_payload.params.memory = truncated_memory;
|
||||||
submit_payload.params.trim_stop = true;
|
submit_payload.params.trim_stop = true;
|
||||||
|
@ -21123,7 +21120,7 @@ Current version indicated by LITEVER below.
|
||||||
const kcppEmbeddingDropdownOption = Array.from(providerdropdown.options).find(opt => opt.value === "2");
|
const kcppEmbeddingDropdownOption = Array.from(providerdropdown.options).find(opt => opt.value === "2");
|
||||||
if(is_using_kcpp_with_embeddings())
|
if(is_using_kcpp_with_embeddings())
|
||||||
{
|
{
|
||||||
kcppEmbeddingDropdownOption.disabled = false;
|
kcppEmbeddingDropdownOption.classList.remove("hidden");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -21131,7 +21128,7 @@ Current version indicated by LITEVER below.
|
||||||
{
|
{
|
||||||
document.getElementById("documentdb_provider").value = 1;
|
document.getElementById("documentdb_provider").value = 1;
|
||||||
}
|
}
|
||||||
kcppEmbeddingDropdownOption.disabled = true;
|
kcppEmbeddingDropdownOption.classList.add("hidden");
|
||||||
}
|
}
|
||||||
toggle_documentdb_provider();
|
toggle_documentdb_provider();
|
||||||
}
|
}
|
||||||
|
@ -22708,7 +22705,7 @@ Current version indicated by LITEVER below.
|
||||||
const embedding = yield generateNewEmbedding(documentContent);
|
const embedding = yield generateNewEmbedding(documentContent);
|
||||||
if (embedding && embedding.data && embedding.data.length > 0 && embedding.data[0].embedding) {
|
if (embedding && embedding.data && embedding.data.length > 0 && embedding.data[0].embedding) {
|
||||||
const newembedding = {
|
const newembedding = {
|
||||||
document: documentName ? documentName : "None",
|
document: documentName ? documentName : "",
|
||||||
hash: hash,
|
hash: hash,
|
||||||
embedding: embedding.data[0].embedding,
|
embedding: embedding.data[0].embedding,
|
||||||
snippet: documentContent,
|
snippet: documentContent,
|
||||||
|
@ -23170,6 +23167,7 @@ Current version indicated by LITEVER below.
|
||||||
const containerRect = gametext.getBoundingClientRect();
|
const containerRect = gametext.getBoundingClientRect();
|
||||||
if (rect.top < containerRect.top || rect.bottom > containerRect.bottom) {
|
if (rect.top < containerRect.top || rect.bottom > containerRect.bottom) {
|
||||||
if (range.startContainer && range.startContainer.nodeType === Node.TEXT_NODE) {
|
if (range.startContainer && range.startContainer.nodeType === Node.TEXT_NODE) {
|
||||||
|
gametext.scrollTop = 0; //simple fix for safari scrolling
|
||||||
const span = document.createElement("span");
|
const span = document.createElement("span");
|
||||||
span.style.display = "inline";
|
span.style.display = "inline";
|
||||||
span.style.background = "transparent";
|
span.style.background = "transparent";
|
||||||
|
@ -23550,7 +23548,7 @@ Current version indicated by LITEVER below.
|
||||||
<option value="0">Disabled</option>
|
<option value="0">Disabled</option>
|
||||||
<option value="1">Local TextDB</option>
|
<option value="1">Local TextDB</option>
|
||||||
<option value="2">KoboldCpp Embeddings</option>
|
<option value="2">KoboldCpp Embeddings</option>
|
||||||
<option value="3">OpenAI Embeddings</option>
|
<option value="3">OpenAI API Embeddings</option>
|
||||||
</select>
|
</select>
|
||||||
<div id="documentdb_oai_buttons" style="display: flex;">
|
<div id="documentdb_oai_buttons" style="display: flex;">
|
||||||
<button type="button" class="btn btn-primary" style="margin:0px; padding:0px; padding-left:2px;padding-right:2px;font-size:11px;margin-right:2px;" onclick="set_oai_embd_url()">Set URL</button>
|
<button type="button" class="btn btn-primary" style="margin:0px; padding:0px; padding-left:2px;padding-right:2px;font-size:11px;margin-right:2px;" onclick="set_oai_embd_url()">Set URL</button>
|
||||||
|
@ -24746,11 +24744,6 @@ Current version indicated by LITEVER below.
|
||||||
class="helptext">Allows you to change the connected custom endpoint at runtime even in local mode.</span></span></div>
|
class="helptext">Allows you to change the connected custom endpoint at runtime even in local mode.</span></span></div>
|
||||||
<input title="Show Local Endpoint Selector" type="checkbox" id="show_endpoint_selector" style="margin:0px 0px 0px 0px;">
|
<input title="Show Local Endpoint Selector" type="checkbox" id="show_endpoint_selector" style="margin:0px 0px 0px 0px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="settinglabel">
|
|
||||||
<div class="justifyleft settingsmall">NeverRewindCtxWindow <span class="helpicon">?<span
|
|
||||||
class="helptext">Prevents ever rewinding to context that has already been shifted out of the context window. </span></span></div>
|
|
||||||
<input title="Never Rewind Context Window" type="checkbox" id="never_rewind_ctx" style="margin:0px 0px 0px 0px;">
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="settingitem wide">
|
<div class="settingitem wide">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue