From afa41c24f555de7ad284bfc3ec859382008570cb Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Sat, 10 Feb 2024 22:08:12 +0800 Subject: [PATCH] small fix lite (+1 squashed commits) Squashed commits: [f22db79a] updated lite --- klite.embd | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/klite.embd b/klite.embd index 59fcb2450..b2528857c 100644 --- a/klite.embd +++ b/klite.embd @@ -6,7 +6,7 @@ It requires no dependencies, installation or setup. Just copy this single static HTML file anywhere and open it in a browser, or from a webserver. Please go to https://github.com/LostRuins/lite.koboldai.net for updates on Kobold Lite. Kobold Lite is under the AGPL v3.0 License unless otherwise exempted. Please do not remove this line. -Current version: 110 +Current version: 111 -Concedo --> @@ -10318,9 +10318,20 @@ Current version: 110 //runs every second var idle_timer = 0; //used in chat mode to send multi replies var idle_triggered_counter = 0; + var idle_backoff_array = [15000,60000,300000,120000]; function poll_background_tasks() { - let idle_timer_max = localsettings.idle_duration*1000; + let idle_timer_max = 0; + if(localsettings.idle_duration>0) + { + idle_timer_max = localsettings.idle_duration*1000; + } + else + { + //smart idle timer + idle_timer_max = idle_backoff_array[idle_triggered_counter>=idle_backoff_array.length?idle_backoff_array.length-1:idle_triggered_counter]; + } + let newgenempty = (document.getElementById("input_text").value == ""); let chatinputempty = (document.getElementById("cht_inp").value == ""); if ((localsettings.opmode == 1 || localsettings.opmode == 2 || localsettings.opmode == 3 || localsettings.opmode == 4) @@ -11147,7 +11158,7 @@ Current version: 110 // Show the 'AI is typing' message if an answer is pending, and prevent the 'send button' from being clicked again. if (pending_response_id=="") { document.getElementById("chatistyping").classList.add("hidden"); } else { - let aiName = ((pending_context_preinjection && pending_context_preinjection.includes(":")) ? pending_context_preinjection.split(":")[0] : "The AI"); + let aiName = ((localsettings.opmode==3 && pending_context_preinjection && pending_context_preinjection.includes(":")) ? pending_context_preinjection.split(":")[0] : "The AI"); document.getElementById("chataityping").innerText = aiName + " is typing..."; document.getElementById("chatistyping").classList.remove("hidden"); } @@ -13274,6 +13285,7 @@ Current version: 110 +