From c38d1ecc8d8f4bcfe2f959584002ddf7a80b8e9b Mon Sep 17 00:00:00 2001
From: Concedo <39025047+LostRuins@users.noreply.github.com>
Date: Sun, 22 Sep 2024 01:32:12 +0800
Subject: [PATCH] update templates, fix rwkv
---
gpttype_adapter.cpp | 2 +-
.../{Mistral V1.json => Mistral-V1.json} | 0
...istral V2 & V3.json => Mistral-V2-V3.json} | 0
... V3-Tekken.json => Mistral-V3-Tekken.json} | 0
klite.embd | 53 +++++++++++++++++--
koboldcpp.py | 2 +-
6 files changed, 51 insertions(+), 6 deletions(-)
rename kcpp_adapters/{Mistral V1.json => Mistral-V1.json} (100%)
rename kcpp_adapters/{Mistral V2 & V3.json => Mistral-V2-V3.json} (100%)
rename kcpp_adapters/{Mistral V3-Tekken.json => Mistral-V3-Tekken.json} (100%)
diff --git a/gpttype_adapter.cpp b/gpttype_adapter.cpp
index 7b295155eefd3..00f73df420403 100644
--- a/gpttype_adapter.cpp
+++ b/gpttype_adapter.cpp
@@ -2807,7 +2807,7 @@ generation_outputs gpttype_generate(const generation_inputs inputs)
{
ContextFastForward(current_context_tokens, embd_inp, n_past, last_n_tokens, nctx, smartcontext, false, true);
}
- if(is_mamba)
+ if(is_mamba || is_rwkv_new)
{
if(n_past==0)
{
diff --git a/kcpp_adapters/Mistral V1.json b/kcpp_adapters/Mistral-V1.json
similarity index 100%
rename from kcpp_adapters/Mistral V1.json
rename to kcpp_adapters/Mistral-V1.json
diff --git a/kcpp_adapters/Mistral V2 & V3.json b/kcpp_adapters/Mistral-V2-V3.json
similarity index 100%
rename from kcpp_adapters/Mistral V2 & V3.json
rename to kcpp_adapters/Mistral-V2-V3.json
diff --git a/kcpp_adapters/Mistral V3-Tekken.json b/kcpp_adapters/Mistral-V3-Tekken.json
similarity index 100%
rename from kcpp_adapters/Mistral V3-Tekken.json
rename to kcpp_adapters/Mistral-V3-Tekken.json
diff --git a/klite.embd b/klite.embd
index 0a205d2c93951..c7af6a494d36d 100644
--- a/klite.embd
+++ b/klite.embd
@@ -4191,6 +4191,7 @@ Current version indicated by LITEVER below.
const default_openrouter_base = "https://openrouter.ai/api/v1";
const default_mistralai_base = "https://api.mistral.ai/v1";
+ const default_featherless_base = "https://api.featherless.ai/v1";
const default_oai_base = "https://api.openai.com";
const default_claude_base = "https://api.anthropic.com";
const default_palm_base = "https://generativelanguage.googleapis.com/v1beta2/models/text-bison-001:generateText?key=";
@@ -4328,6 +4329,7 @@ Current version indicated by LITEVER below.
saved_oai_tts_url: (default_oai_base + "/v1" + default_oai_tts_endpoint),
saved_openrouter_key: "",
saved_mistralai_key: "",
+ saved_featherless_key: "",
saved_claude_key: "", //do not ever share this in save files!
saved_claude_addr: default_claude_base, //do not ever share this in save files!
saved_palm_key: "", //do not ever share this in save files!
@@ -6072,6 +6074,7 @@ Current version indicated by LITEVER below.
new_save_storyobj.savedsettings.saved_kai_key = "";
new_save_storyobj.savedsettings.saved_openrouter_key = "";
new_save_storyobj.savedsettings.saved_mistralai_key = "";
+ new_save_storyobj.savedsettings.saved_featherless_key = "";
new_save_storyobj.savedsettings.saved_palm_key = "";
new_save_storyobj.savedsettings.saved_cohere_key = "";
@@ -6410,6 +6413,7 @@ Current version indicated by LITEVER below.
let tmp_oai6 = localsettings.saved_oai_tts_url;
let tmp_or1 = localsettings.saved_openrouter_key;
let tmp_mai = localsettings.saved_mistralai_key;
+ let tmp_fai = localsettings.saved_featherless_key;
let tmp_claude1 = localsettings.saved_claude_key;
let tmp_claude2 = localsettings.saved_claude_addr;
let tmp_palm1 = localsettings.saved_palm_key;
@@ -6448,6 +6452,7 @@ Current version indicated by LITEVER below.
localsettings.saved_oai_tts_url = tmp_oai6;
localsettings.saved_openrouter_key = tmp_or1;
localsettings.saved_mistralai_key = tmp_mai;
+ localsettings.saved_featherless_key = tmp_fai;
localsettings.saved_claude_key = tmp_claude1;
localsettings.saved_claude_addr = tmp_claude2;
localsettings.saved_palm_key = tmp_palm1;
@@ -8275,6 +8280,8 @@ Current version indicated by LITEVER below.
return document.getElementById("custom_openrouter_model");
case "7":
return document.getElementById("custom_mistralai_model");
+ case "8":
+ return document.getElementById("custom_featherless_model");
default:
return document.getElementById("custom_oai_model");
}
@@ -8437,6 +8444,7 @@ Current version indicated by LITEVER below.
document.getElementById("custom_oai_model").classList.add("hidden");
document.getElementById("custom_openrouter_model").classList.add("hidden");
document.getElementById("custom_mistralai_model").classList.add("hidden");
+ document.getElementById("custom_featherless_model").classList.add("hidden");
document.getElementById("hordeloadmodelcontainer").classList.add("hidden");
document.getElementById("coherecustom").classList.add("hidden");
@@ -8454,11 +8462,12 @@ Current version indicated by LITEVER below.
document.getElementById("customkoboldkey").value = localsettings.saved_kai_key;
}
}
- else if(epchoice==2 || epchoice==3 || epchoice==7)
+ else if(epchoice==2 || epchoice==3 || epchoice==7 || epchoice==8)
{
document.getElementById("oaicustom").classList.remove("hidden");
document.getElementById("openrouterdesc").classList.add("hidden");
document.getElementById("mistralaidesc").classList.add("hidden");
+ document.getElementById("featherlessdesc").classList.add("hidden");
document.getElementById("oaidesc").classList.add("hidden");
if(epchoice==2)
{
@@ -8481,6 +8490,15 @@ Current version indicated by LITEVER below.
document.getElementById("custom_oai_key").value = localsettings.saved_mistralai_key;
document.getElementById("custom_oai_endpoint").value = default_mistralai_base;
}
+ else if(epchoice==8)
+ {
+ document.getElementById("custom_featherless_model").classList.remove("hidden");
+ document.getElementById("featherlessdesc").classList.remove("hidden");
+ document.getElementById("custom_oai_endpoint").classList.add("hidden");
+ document.getElementById("custom_oai_key").value = localsettings.saved_featherless_key;
+ document.getElementById("custom_oai_endpoint").value = default_featherless_base;
+ try_fetch_oai_models_auto();
+ }
else //openrouter supports autofetch
{
document.getElementById("openrouterdesc").classList.remove("hidden");
@@ -8891,7 +8909,7 @@ Current version indicated by LITEVER below.
});
}
}
- else if(epchoice==2 || epchoice==3 || epchoice==7) //connect to OAI / OpenRouter / MistralAI Endpoint
+ else if(epchoice==2 || epchoice==3 || epchoice==7 || epchoice==8) //connect to OAI / OpenRouter / MistralAI / Featherless Endpoint
{
let desired_oai_key = document.getElementById("custom_oai_key").value.trim();
let desired_oai_ep = document.getElementById("custom_oai_endpoint").value.trim();
@@ -8923,6 +8941,10 @@ Current version indicated by LITEVER below.
{
localsettings.saved_mistralai_key = custom_oai_key;
}
+ else if(epchoice==8)
+ {
+ localsettings.saved_featherless_key = custom_oai_key;
+ }
else
{
localsettings.saved_openrouter_key = custom_oai_key;
@@ -16292,6 +16314,9 @@ Current version indicated by LITEVER below.
}else if(custom_oai_endpoint.toLowerCase().includes("api.mistral.ai"))
{
localsettings.prev_custom_endpoint_type = 7;
+ }else if(custom_oai_endpoint.toLowerCase().includes("featherless.ai"))
+ {
+ localsettings.prev_custom_endpoint_type = 8;
}
}
else if(custom_claude_key!="")
@@ -17821,12 +17846,13 @@ Current version indicated by LITEVER below.
@@ -17896,9 +17922,14 @@ Current version indicated by LITEVER below.
Note that KoboldAI Lite takes no responsibility for your usage or consequences of this feature. Your API key is used directly with the MistralAI API and is not transmitted to us.
Only Temperature and Top-P samplers are used.
Please input MistralAI Key.
+
+ Entering your Featherless API key will allow you to use KoboldAI Lite with their API.
+ Note that KoboldAI Lite takes no responsibility for your usage or consequences of this feature. Your API key is used directly with the Featherless API and is not transmitted to us.
Only Temperature, Top-P, Top-K, Min-P and Repetition Penalty samplers are used.
+ Please input Featherless Key.
+
-
+
Model Choice:
+