diff --git a/embd_res/klite.embd b/embd_res/klite.embd index d2b2aeb60..c02313c7e 100644 --- a/embd_res/klite.embd +++ b/embd_res/klite.embd @@ -487,13 +487,13 @@ Current version indicated by LITEVER below. } } - body.connected.corpoui .topmenu { + /* body.connected.corpoui .topmenu { --theme_color_topmenu: #337ab7; } body.connected.darkmode.corpoui .topmenu { --theme_color_topmenu: #32496d; - } - body.connected.corpoui .nav-link { + } */ + /* body.connected.corpoui .nav-link { --theme_color_topbtn: #4787be; } body.connected.corpoui .nav-link:hover { @@ -504,7 +504,7 @@ Current version indicated by LITEVER below. } body.connected.darkmode.corpoui .nav-link:hover { --theme_color_topbtn_highlight: #596985; - } + } */ /* Global appearances */ body { @@ -2559,6 +2559,9 @@ Current version indicated by LITEVER below. { color: #dddddd; } + .corpo_chat_inner::placeholder { /*need to overwrite this input*/ + color: revert; + } .corpo_chat_img_btn { background: #000000 none repeat scroll 0 0; @@ -10939,7 +10942,7 @@ Current version indicated by LITEVER below. let righttoggle = ""; if(temp_scenario.opmode==3 || temp_scenario.opmode==2) { - righttoggle = `?Load scenario in Instruct Mode instead of Chat Mode. Some AI models need this format. Use Instruct Mode `; + righttoggle = `?Load scenario in Instruct Mode instead of Chat Mode. Some AI models need this format. Use Instruct Mode `; } let scenario_desc = `${image}${righttoggle}

${escape_html(temp_scenario.title)}

Mode: ${modetitle}${author}

${blurb}

`; @@ -11410,17 +11413,18 @@ Current version indicated by LITEVER below. }, // aicharactercards.com { - name: "aicharactercards.com / character-tavern.com", + name: "aicharactercards.com", urlParam: "aicc", inputBox: { - text: "Enter aicharactercards.com or character-tavern.com card URL", + text: "Enter aicharactercards.com card URL", placeholder: "https://aicharactercards.com/character-cards/work-jobs/deffcolony/lara-lightland", }, extraction: (userInput) => { if (userInput.match(/aicharactercards\.com\//i) && userInput.match(/sdm_process_download/i)) { return userInput; - } else if(userInput.match(/character-tavern\.com\//i)) + } + else if(userInput.match(/character-tavern\.com\//i)) { userInput = userInput.replaceAll("%20","%2520"); if(userInput.match(/com\/character\//i)) @@ -11495,42 +11499,45 @@ Current version indicated by LITEVER below. }); } }, + //character-tavern, duplicated and split for now { - name: "char-archive.evulid.cc", - urlParam: "carc", + name: "character-tavern.com", + urlParam: "aicc", inputBox: { - text: "Enter char-archive.evulid.cc card URL", - placeholder: "https://char-archive.evulid.cc/#/chub/Cyber_Elite/character/Cat", + text: "Enter character-tavern.com card URL", + placeholder: "https://character-tavern.com/character/yousef/Shinku", }, extraction: (userInput) => { - if (userInput.match(/char-archive\.evulid\.cc\/\#\//i)) - { - let parsedInput = userInput.split("?")[0]; - parsedInput = parsedInput.split("char-archive.evulid.cc/#/")[1]; - let parts = parsedInput.split("/"); - - if (parts.length == 3) { - let final = parts[2]; - final = final.includes("+")?("+"+final.split("+")[1]):final; - return `https://char-archive.evulid.cc/api/archive/v1/${parts[0]}/image/character/${final}?definition=true`; - } - if (parts.length == 2 || parts[0] == 'generic') { - let final = parts[1]; - final = final.includes("+")?(final.split("+")[1]):final; - return `https://char-archive.evulid.cc/api/archive/v1/${parts[0]}/image/character/${final}?definition=true`; - } - if (parts.length !== 4 || parts[2] !== 'character') { - //bad format, return original - return userInput; - } - let final = parts[3]; - final = final.includes("+")?("+"+final.split("+")[1]):final; - return `https://char-archive.evulid.cc/api/archive/v1/${parts[0]}/image/character/${parts[1]}/${final}?definition=true`; - } - else + if (userInput.match(/aicharactercards\.com\//i) && userInput.match(/sdm_process_download/i)) { return userInput; } + else if(userInput.match(/character-tavern\.com\//i)) + { + userInput = userInput.replaceAll("%20","%2520"); + if(userInput.match(/com\/character\//i)) + { + userInput = userInput.split(".png")[0]; + userInput = userInput.split("?")[0]; + userInput = userInput.split(".com/character/")[1]; + userInput = userInput.endsWith('/') ? userInput.slice(0, -1) : userInput; + return `https://cards.character-tavern.com/${userInput}.png?action=download`; + } + return userInput; + } + else { + userInput = userInput.split("#")[0].split("?")[0]; + userInput = userInput.endsWith('/') ? userInput.slice(0, -1) : userInput; + if (userInput.match(/aicharactercards\.com\//i) || userInput.match(/AICC\//i)) { + // is a URL, extract the character name + let tmp = userInput.split("/"); + if(tmp.length >= 2) + { + userInput = tmp[tmp.length-2] + "/" + tmp[tmp.length-1]; + } + } + return "https://aicharactercards.com/wp-json/pngapi/v1/image/"+userInput; + } }, fetch: (userInput) => { temp_scenario = { @@ -11580,6 +11587,93 @@ Current version indicated by LITEVER below. }); } }, + + // char-archive has shut down + // { + // name: "char-archive.evulid.cc", + // urlParam: "carc", + // inputBox: { + // text: "Enter char-archive.evulid.cc card URL", + // placeholder: "https://char-archive.evulid.cc/#/chub/Cyber_Elite/character/Cat", + // }, + // extraction: (userInput) => { + // if (userInput.match(/char-archive\.evulid\.cc\/\#\//i)) + // { + // let parsedInput = userInput.split("?")[0]; + // parsedInput = parsedInput.split("char-archive.evulid.cc/#/")[1]; + // let parts = parsedInput.split("/"); + + // if (parts.length == 3) { + // let final = parts[2]; + // final = final.includes("+")?("+"+final.split("+")[1]):final; + // return `https://char-archive.evulid.cc/api/archive/v1/${parts[0]}/image/character/${final}?definition=true`; + // } + // if (parts.length == 2 || parts[0] == 'generic') { + // let final = parts[1]; + // final = final.includes("+")?(final.split("+")[1]):final; + // return `https://char-archive.evulid.cc/api/archive/v1/${parts[0]}/image/character/${final}?definition=true`; + // } + // if (parts.length !== 4 || parts[2] !== 'character') { + // //bad format, return original + // return userInput; + // } + // let final = parts[3]; + // final = final.includes("+")?("+"+final.split("+")[1]):final; + // return `https://char-archive.evulid.cc/api/archive/v1/${parts[0]}/image/character/${parts[1]}/${final}?definition=true`; + // } + // else + // { + // return userInput; + // } + // }, + // fetch: (userInput) => { + // temp_scenario = { + // "title":"", + // "desc": "", + // "opmode":3, + // "chatopponent": "", + // "gui_type":1, + // "prompt":"", + // "memory": "", + // "authorsnote": "", + // "worldinfo": [], + // }; + + // finalurl = apply_proxy_url(userInput,true); + // //try to obtain the full portrait image + // return fetch(finalurl, { + // method: 'GET', + // redirect: 'follow', + // referrerPolicy: 'no-referrer', + // }) + // .then(rb => { + // if(rb.ok) + // { + // return rb.blob(); + // }else{ + // throw new Error('Cannot fetch tavern image'); + // } + // }) + // .then(blob => { + // preview_temp_scenario(); + + // readTavernPngFromBlob(blob,(obj)=>{ + // load_temp_scenario_from_tavernobj(obj); + // }); + + // const objectURL = URL.createObjectURL(blob); + // const compressedImg = compressImage(objectURL, (compressedImageURI, aspectratio)=>{ + // temp_scenario.image = compressedImageURI; + // temp_scenario.image_aspect = aspectratio; + // preview_temp_scenario(); + // }, true, AVATAR_PX); + // }) + // .catch(error => { + // throw new Error("Selected scenario is invalid."); + // console.error(error); + // }); + // } + // }, ]; /** @@ -11758,7 +11852,7 @@ Current version indicated by LITEVER below. let cn = lpc[i]; lastlogprobsstr += `${escape_html(cn.token)}
(${(Math.exp(cn.logprob)*100).toFixed(2)}%)`; let addspace = false; - for(let j=0;j<5;++j) + for(let j=0;j<15;++j) { if(j>=cn.top_logprobs.length) { diff --git a/koboldcpp.py b/koboldcpp.py index b7426c2dc..723661fb6 100755 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -67,7 +67,7 @@ dry_seq_break_max = 128 extra_images_max = 4 # for kontext/qwen img # global vars -KcppVersion = "1.106.1" +KcppVersion = "1.106.2" showdebug = True kcpp_instance = None #global running instance global_memory = {"tunnel_url": "", "restart_target":"", "input_to_exit":False, "load_complete":False, "restart_override_config_target":""} diff --git a/src/llama-context.cpp b/src/llama-context.cpp index 9b52a29cf..7cfc8b7c3 100644 --- a/src/llama-context.cpp +++ b/src/llama-context.cpp @@ -413,6 +413,7 @@ void llama_context::sched_reserve() { sched.reset(ggml_backend_sched_new(backend_ptrs.data(), backend_buft.data(), backend_ptrs.size(), max_nodes, cparams.pipeline_parallel, cparams.op_offload)); + if (memory) { //added by kcpp to reduce embeddings memory usage llama_memory_context_ptr mctx; if (memory) { LLAMA_LOG_DEBUG("%s: reserving full memory module\n", __func__); @@ -547,6 +548,7 @@ void llama_context::sched_reserve() { LLAMA_LOG_INFO("%s: reserve took %.2f ms, sched copies = %d\n", __func__, (t_end_us - t_start_us)/1000.0, ggml_backend_sched_get_n_copies(sched.get())); + } //end kcpp fix to reduce embeddings memory usage } void llama_context::synchronize() {