From 82202aebda309b22b54ad190ca3dba3feb5df133 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Tue, 2 Jul 2024 21:02:52 +0800 Subject: [PATCH] updated lite, add gemma 2 template --- kcpp_adapters/ChatML.json | 6 +++--- kcpp_adapters/Gemma-2.json | 8 ++++++++ klite.embd | 16 +++++++++++----- 3 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 kcpp_adapters/Gemma-2.json diff --git a/kcpp_adapters/ChatML.json b/kcpp_adapters/ChatML.json index cce602525708f..b20d825078638 100644 --- a/kcpp_adapters/ChatML.json +++ b/kcpp_adapters/ChatML.json @@ -1,8 +1,8 @@ { -"system_start":"<|im_start|>system", +"system_start":"<|im_start|>system\n", "system_end":"<|im_end|>", -"user_start":"<|im_start|>user", +"user_start":"<|im_start|>user\n", "user_end":"<|im_end|>", -"assistant_start":"<|im_start|>assistant", +"assistant_start":"<|im_start|>assistant\n", "assistant_end":"<|im_end|>" } \ No newline at end of file diff --git a/kcpp_adapters/Gemma-2.json b/kcpp_adapters/Gemma-2.json new file mode 100644 index 0000000000000..ab35ec74daa30 --- /dev/null +++ b/kcpp_adapters/Gemma-2.json @@ -0,0 +1,8 @@ +{ +"system_start":"system\n", +"system_end":"", +"user_start":"user\n", +"user_end":"", +"assistant_start":"assistant\n", +"assistant_end":"" +} \ No newline at end of file diff --git a/klite.embd b/klite.embd index 0fd16a707974a..57a7c44c5322e 100644 --- a/klite.embd +++ b/klite.embd @@ -2692,9 +2692,11 @@ Current version: 148 return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2) }).join('')) } + + var no_escape_html = false; function escapeHtml(unsafe) { - if(localsettings.no_escape_html) + if(no_escape_html) { return unsafe; } @@ -2707,7 +2709,7 @@ Current version: 148 } function unescapeHtml(input) { - if(localsettings.no_escape_html) + if(no_escape_html) { return input; } @@ -3810,7 +3812,6 @@ Current version: 148 xtts_voice: "female_calm", beep_on: false, notify_on: false, - no_escape_html: false, narrate_both_sides: false, narrate_only_dialog: false, image_styles: "", @@ -8744,7 +8745,7 @@ Current version: 148 toggle_tts_mode(); document.getElementById("beep_on").checked = localsettings.beep_on; document.getElementById("notify_on").checked = localsettings.notify_on; - document.getElementById("no_escape_html").checked = localsettings.no_escape_html; + document.getElementById("no_escape_html").checked = no_escape_html; document.getElementById("narrate_both_sides").checked = localsettings.narrate_both_sides; document.getElementById("narrate_only_dialog").checked = localsettings.narrate_only_dialog; toggle_opmode(); @@ -8995,7 +8996,7 @@ Current version: 148 localsettings.xtts_voice = document.getElementById("xtts_voices").value; localsettings.beep_on = (document.getElementById("beep_on").checked?true:false); localsettings.notify_on = (document.getElementById("notify_on").checked?true:false); - localsettings.no_escape_html = (document.getElementById("no_escape_html").checked?true:false); + no_escape_html = (document.getElementById("no_escape_html").checked?true:false); localsettings.narrate_both_sides = (document.getElementById("narrate_both_sides").checked?true:false); localsettings.narrate_only_dialog = (document.getElementById("narrate_only_dialog").checked?true:false); localsettings.auto_ctxlen = (document.getElementById("auto_ctxlen").checked ? true : false); @@ -9130,6 +9131,10 @@ Current version: 148 case "10": // Phi-3 Mini st = "<|end|><|user|>\\n"; et = "<|end|>\\n<|assistant|>"; + break; + case "11": // Gemma 2 + st = "\\nuser\\n"; + et = "\\nassistant\\n"; break; default: break; @@ -16153,6 +16158,7 @@ Current version: 148 +
Sys. Prompt ?A system pre-prompt sent at the very start to guide the AI behavior. Usually NOT needed.