From 5c1654f020c3027f4f916a302ad16e9b6adef403 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Wed, 14 May 2025 21:17:50 +0800 Subject: [PATCH] updated lite --- klite.embd | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/klite.embd b/klite.embd index 7f0824932..76f3e754a 100644 --- a/klite.embd +++ b/klite.embd @@ -3023,6 +3023,7 @@ Current version indicated by LITEVER below. const dummy_pollinations_key = "kobo"; //for optionally uploading content to share on dpaste + const dpaste_submit_endpoint = "https://dpaste.org/api/"; const dpaste_fetch_endpoint = "https://dpaste.org/"; //support for quick news updates @@ -5822,7 +5823,16 @@ Current version indicated by LITEVER below. dpurl = `https://${foundDpaste}` } } - fetch(`${dpurl}/raw`) + + if(foundDpaste.toLowerCase().includes("dpaste.com")) + { + dpurl = `${dpurl}.txt` + } + else + { + dpurl = `${dpurl}/raw` + } + fetch(dpurl) .then(x => { if(x.ok) { @@ -6647,7 +6657,7 @@ Current version indicated by LITEVER below. console.log("Export Len: " + cstoryjson.length); const params = new URLSearchParams(); params.append("content", cstoryjson); - params.append("expiry", expiry); + params.append("expires", expiry); fetch(serverurl, { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, @@ -6664,8 +6674,11 @@ Current version indicated by LITEVER below. }) .then((text) => { let pasteurl = replaceAll(text,"\"",""); - pasteurl = pasteurl.split("/"); - pasteurl = pasteurl[pasteurl.length-1]; + if(dpaste_submit_endpoint==serverurl) + { + pasteurl = pasteurl.split("/"); + pasteurl = pasteurl[pasteurl.length-1]; + } let fullurl = "https://lite.koboldai.net/?dp=" + pasteurl; document.getElementById("shareasurl").classList.add("hidden"); document.getElementById("shareastext").classList.remove("hidden"); @@ -15324,6 +15337,7 @@ Current version indicated by LITEVER below. "model": custom_oai_model, "temperature": submit_payload.params.temperature, "top_p": submit_payload.params.top_p, + "stop": get_stop_sequences().slice(0, 4), //lets try adding stop sequences, limit to first 4 } if(localsettings.request_logprobs && !targetep.toLowerCase().includes("api.x.ai") && !targetep.toLowerCase().includes("api.mistral.ai")) { @@ -15460,9 +15474,6 @@ Current version indicated by LITEVER below. } } oai_payload.prompt = submit_payload.prompt; - - //lets try adding stop sequences, limit to first 4 - oai_payload.stop = get_stop_sequences().slice(0, 4); } last_request_str = JSON.stringify(oai_payload); @@ -15734,7 +15745,7 @@ Current version indicated by LITEVER below. "topP": submit_payload.params.top_p, "topK": geminitopk, "candidateCount":1, - "stopSequences": [] + "stopSequences": get_stop_sequences().slice(0, 4) } };