Skip to content

Commit

Permalink
updated lite, add gemma 2 template
Browse files Browse the repository at this point in the history
  • Loading branch information
LostRuins committed Jul 2, 2024
1 parent 7499a6b commit 82202ae
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
6 changes: 3 additions & 3 deletions kcpp_adapters/ChatML.json
Original file line number Diff line number Diff line change
@@ -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|>"
}
8 changes: 8 additions & 0 deletions kcpp_adapters/Gemma-2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"system_start":"<start_of_turn>system\n",
"system_end":"<end_of_turn>",
"user_start":"<start_of_turn>user\n",
"user_end":"<end_of_turn>",
"assistant_start":"<start_of_turn>assistant\n",

This comment has been minimized.

Copy link
@doublescale

doublescale Jul 4, 2024

According to https://huggingface.co/google/gemma-2-27b-it , it looks like this should use "<start_of_turn>model", not "<start_of_turn>assistant".

"assistant_end":"<end_of_turn>"
}
16 changes: 11 additions & 5 deletions klite.embd
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -2707,7 +2709,7 @@ Current version: 148
}
function unescapeHtml(input)
{
if(localsettings.no_escape_html)
if(no_escape_html)
{
return input;
}
Expand Down Expand Up @@ -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: "",
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 = "<end_of_turn>\\n<start_of_turn>user\\n";
et = "<end_of_turn>\\n<start_of_turn>assistant\\n";
break;
default:
break;
Expand Down Expand Up @@ -16153,6 +16158,7 @@ Current version: 148
<option value="8">CommandR</option>
<option value="9">Llama 3 Chat</option>
<option value="10">Phi-3</option>
<option value="11">Gemma-2</option>
</select>
<div class="settingsmall miniinput" style="width:100%;padding:2px">
<div class="justifyleft settingsmall">Sys. Prompt <span class="helpicon">?<span class="helptext">A system pre-prompt sent at the very start to guide the AI behavior. Usually NOT needed.</span></span></div>
Expand Down

0 comments on commit 82202ae

Please sign in to comment.