This commit is contained in:
Concedo 2026-02-26 14:46:41 +08:00
parent edbc4fe592
commit b7d2fe68e7
2 changed files with 33 additions and 4 deletions

View file

@ -12,7 +12,7 @@ Current version indicated by LITEVER below.
-->
<head>
<script id="init-config">
const LITEVER = 315;
const LITEVER = 316;
const urlParams = new URLSearchParams(window.location.search);
var localflag = urlParams.get('local'); //this will be replaced automatically in embedded kcpp
const STORAGE_PREFIX = (localflag?"e_":"")+"kaihordewebui_";
@ -3548,7 +3548,7 @@ Current version indicated by LITEVER below.
const favivon_normal =rootStyles.getPropertyValue('--img_favicon_normal').match(/url\("(.*)"\)/)[1];
// whitelisted auto selected horde model names
const defaultmodels = ["gpt4all","supercot","pygmalion-6","pygmalion-v8","pygmalion-2","hermes","airoboros","chrono","wizard","mantis","vicuna","manticore","alpaca","myth","xwin","spicyboros","mlewd","mxlewd","westlake","anubis","skyfall","llama2","llama3","llama-2","llama-3-","llama-3.","mistral","maid","mixtral","estopia","fighter","fimbul","euryale","nemo","gemma","lunaris","stheno","magnum","cydonia","qwen2.5-32b","behemoth","exaone","glm4","glm-4","tutu","deepseek"];
const defaultmodels = ["gpt4all","supercot","pygmalion-6","pygmalion-v8","pygmalion-2","hermes","airoboros","chrono","wizard","mantis","vicuna","manticore","alpaca","myth","xwin","spicyboros","mlewd","mxlewd","westlake","anubis","skyfall","llama2","llama3","llama-2","llama-3-","llama-3.","mistral","maid","mixtral","estopia","fighter","fimbul","euryale","nemo","gemma","lunaris","stheno","magnum","cydonia","qwen2.5-32b","behemoth","exaone","glm4","glm-4","tutu","deepseek","tlacuilo","rocinante"];
const ignoredmodels = ["tinyllama","debug-","-1b","-270m"]; //blacklisted model names
const instructstartplaceholder = "\n{{[INPUT]}}\n";
@ -4304,6 +4304,7 @@ Current version indicated by LITEVER below.
var koboldcpp_has_guidance = false;
var koboldcpp_has_jinja = false;
var koboldcpp_has_mcp = false;
var koboldcpp_has_musicgen = false;
var no_escape_html = false;
var timetaken_timestamp = performance.now();
var bg_silence = null;
@ -9352,6 +9353,10 @@ Current version indicated by LITEVER below.
function is_using_kcpp_with_mcp()
{
return (custom_kobold_endpoint!="" && koboldcpp_version && koboldcpp_version!="" && compare_version_str(koboldcpp_version, "1.105") >= 0 && koboldcpp_has_mcp);
}
function is_using_kcpp_with_musicgen()
{
return (custom_kobold_endpoint!="" && koboldcpp_version && koboldcpp_version!="" && compare_version_str(koboldcpp_version, "1.108") >= 0 && koboldcpp_has_musicgen);
}
function is_using_web_lite()
{
@ -12475,6 +12480,10 @@ Current version indicated by LITEVER below.
{
window.open('./sdui','_blank');
}
function go_to_musicui()
{
window.open('./musicui','_blank');
}
function go_to_lcppui()
{
window.open('./lcpp','_blank');
@ -13692,6 +13701,7 @@ Current version indicated by LITEVER below.
koboldcpp_has_embeddings = (data.embeddings ? true : false);
koboldcpp_has_jinja = (data.jinja ? true : false);
koboldcpp_has_mcp = (data.mcp ? true : false);
koboldcpp_has_musicgen = (data.music ? true : false);
let has_password = (data.protected?true:false);
koboldcpp_has_txt2img = (data.txt2img?true:false);
let no_txt_model = (mdlname=="inactive");
@ -13811,6 +13821,13 @@ Current version indicated by LITEVER below.
},()=>{
});
}
else if(localflag && koboldcpp_has_musicgen && no_txt_model && safe_to_overwrite())
{
msgboxYesNo("This KoboldCpp instance seems to be running an Music Generation model without any Text Generation model loaded.\n\nWould you like to launch MusicUI (Dedicated Music Generation WebUI bundled with KoboldCpp)?\n\nIf unsure, select 'Yes'.","Launch MusicUI?", ()=>{
go_to_musicui();
},()=>{
});
}
else if(localflag && no_txt_model && !koboldcpp_has_txt2img && !koboldcpp_has_vision && !koboldcpp_has_whisper && !koboldcpp_has_tts && !is_using_kcpp_with_admin())
{
msgboxYesNo("This KoboldCpp instance has no models loaded. You can still use the WebUI to edit or view existing stories.<br><br>Would you like to connect to an external API service?","No Models Loaded",
@ -16190,6 +16207,15 @@ Current version indicated by LITEVER below.
document.getElementById("btn_open_stableui").classList.add("hidden");
}
if(is_using_kcpp_with_musicgen())
{
document.getElementById("btn_open_musicui").classList.remove("hidden");
}
else
{
document.getElementById("btn_open_musicui").classList.add("hidden");
}
if(is_using_kcpp_with_lcppui())
{
document.getElementById("btn_open_lcppui").classList.remove("hidden");
@ -31349,6 +31375,9 @@ Current version indicated by LITEVER below.
<div class="menutext hidden" id="btn_open_stableui">
<button type="button" class="btn btn-primary bg_purple" onclick="go_to_stableui()">Launch StableUI</button>
</div>
<div class="menutext hidden" id="btn_open_musicui">
<button type="button" class="btn btn-primary bg_purple" onclick="go_to_musicui()">Launch MusicUI</button>
</div>
<div class="menutext hidden" id="btn_open_lcppui">
<button type="button" class="btn btn-primary bg_purple" onclick="go_to_lcppui()">Launch llama.cpp UI</button>
</div>

View file

@ -836,7 +836,7 @@ static std::vector<std::string> generate_phase1_batch(
if (fsm_template && fsm_template->enabled)
seqs[i].fsm.apply_mask(lg.data());
int tok = kcpp_quick_sample(lg.data(),V,std::vector<int32_t>(),1.03f,top_p,25,temperature,acestep_lm_rng);
int tok = kcpp_quick_sample(lg.data(),V,std::vector<int32_t>(),1.04f,top_p,30,temperature,acestep_lm_rng);
if (tok == TOKEN_IM_END) {
seqs[i].done = true;
@ -906,7 +906,7 @@ static std::vector<std::string> generate_phase1_batch(
for (int v = AUDIO_CODE_BASE; v < AUDIO_CODE_COUNT+AUDIO_CODE_BASE; v++)
if (v != TOKEN_IM_END) lc[v] = -1e9f;
int tok = kcpp_quick_sample(lc,V,quicklastntoks,1.03f,top_p,25,temperature,acestep_lm_rng);
int tok = kcpp_quick_sample(lc,V,quicklastntoks,1.04f,top_p,30,temperature,acestep_lm_rng);
quicklastntoks.push_back(tok);
if (quicklastntoks.size()>32) {
quicklastntoks.erase(quicklastntoks.begin());