Skip to content

Commit

Permalink
update templates, fix rwkv
Browse files Browse the repository at this point in the history
  • Loading branch information
LostRuins committed Sep 21, 2024
1 parent d4d19f6 commit c38d1ec
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gpttype_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
53 changes: 49 additions & 4 deletions klite.embd
Original file line number Diff line number Diff line change
Expand Up @@ -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=";
Expand Down Expand Up @@ -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!
Expand Down Expand Up @@ -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 = "";

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}
Expand Down Expand Up @@ -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");

Expand All @@ -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)
{
Expand All @@ -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");
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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!="")
Expand Down Expand Up @@ -17821,12 +17846,13 @@ Current version indicated by LITEVER below.
<select title="Select your AI provider" style="padding:4px;" class="form-control" id="customapidropdown" onchange="customapi_dropdown(true)">
<option value="0">AI Horde</option>
<option value="1">KoboldAI Remote API</option>
<option value="2">OpenAI API</option>
<option value="2">OpenAI Compatible API</option>
<option value="3">OpenRouter API</option>
<option value="4">Claude By Anthropic API</option>
<option value="5">PaLM/Gemini By Google API</option>
<option value="6">Cohere API</option>
<option value="7">MistralAI API</option>
<option value="8">Featherless API</option>
</select>
</div>

Expand Down Expand Up @@ -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.<br>Only Temperature and Top-P samplers are used.<br><br>
<span class="color_green" style="font-weight: bold;">Please input MistralAI Key.</span><br><br>
</span>
<span id="featherlessdesc" class="hidden">
Entering your Featherless API key will allow you to use KoboldAI Lite with their API.<br><br>
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.<br>Only Temperature, Top-P, Top-K, Min-P and Repetition Penalty samplers are used.<br><br>
<span class="color_green" style="font-weight: bold;">Please input Featherless Key.</span><br><br>
</span>

<input class="form-control" type="text" id="custom_oai_endpoint" placeholder="OpenAI API URL" value="" onblur="try_fetch_oai_models_auto()">
<input class="form-control" type="password" id="custom_oai_key" placeholder="OpenAI API Key (Required)" value="" onfocus="focus_api_keys()" onblur="blur_api_keys()"><br>
<input class="form-control" type="password" id="custom_oai_key" placeholder="API Key (Required)" value="" onfocus="focus_api_keys()" onblur="blur_api_keys()"><br>
Model Choice:<br>
<select style="padding:4px;display:inline;width:calc(100% - 220px)" class="form-control" id="custom_oai_model" onchange="oai_model_change(true)">
<option value="gpt-3.5-turbo-instruct" selected="selected">gpt-3.5-turbo-instruct</option>
Expand Down Expand Up @@ -17933,6 +17964,20 @@ Current version indicated by LITEVER below.
<option value="mistral-large-latest">mistral-large-latest</option>
<option style="display:none;" class="custom_model_option" value="custom">[Custom]</option>
</select>
<select style="padding:4px;display:inline;width:calc(100% - 220px)" class="form-control hidden" id="custom_featherless_model" onchange="oai_model_change(true)">
<option value="Sao10K/L3-8B-Lunaris-v1">Sao10K/L3-8B-Lunaris-v1</option>
<option value="Sao10K/L3-8B-Stheno-v3.2">Sao10K/L3-8B-Stheno-v3.2</option>
<option value="unsloth/llama-3-8b-Instruct">unsloth/llama-3-8b-Instruct</option>
<option value="beomi/Llama-3-Open-Ko-8B">beomi/Llama-3-Open-Ko-8B</option>
<option value="Sao10K/Fimbulvetr-11B-v2">Sao10K/Fimbulvetr-11B-v2</option>
<option value="HuggingFaceH4/zephyr-7b-beta">HuggingFaceH4/zephyr-7b-beta</option>
<option value="upstage/SOLAR-10.7B-Instruct-v1.0">upstage/SOLAR-10.7B-Instruct-v1.0</option>
<option value="alpindale/magnum-72b-v1">alpindale/magnum-72b-v1</option>
<option value="Sao10K/L3-70B-Euryale-v2.1">Sao10K/L3-70B-Euryale-v2.1</option>
<option value="alpindale/WizardLM-2-8x22B">alpindale/WizardLM-2-8x22B</option>
<option value="meta-llama/Meta-Llama-3.1-405B-Instruct">meta-llama/Meta-Llama-3.1-405B-Instruct</option>
<option style="display:none;" class="custom_model_option" value="custom">[Custom]</option>
</select>
<button type="button" class="btn btn-primary" style="display:inline;width:105px;" id="oaifetchlist" onclick="oai_fetch_models()">Fetch List</button>
<button type="button" class="btn btn-primary" style="display:inline;width:105px;" id="oaiusecustom" onclick="select_custom_oai_model()">Use Custom</button>
<div style="display:inline-flex">
Expand Down
2 changes: 1 addition & 1 deletion koboldcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
modelbusy = threading.Lock()
requestsinqueue = 0
defaultport = 5001
KcppVersion = "1.75.1"
KcppVersion = "1.75.2"
showdebug = True
guimode = False
showsamplerwarning = True
Expand Down

0 comments on commit c38d1ec

Please sign in to comment.