move files, clean code

This commit is contained in:
Yazan Agha-Schrader 2024-05-30 01:13:10 +02:00
parent 63de7201fa
commit 89b1b38144
13 changed files with 633 additions and 382 deletions

View file

@ -0,0 +1,402 @@
@import url("theme-snowstorm.css");
@import url("theme-polarnight.css");
@import url("theme-ketivah.css");
@import url("theme-mangotango.css");
@import url("theme-playground.css");
@import url("theme-beeninorder.css");
:root {
/* ---------- PRIMARY COLORS ----------------- */
--primary-color-1: hsl(217.5, 26.7%, 94.1%);
--primary-color-1-hue: 217.5;
--primary-color-1-saturation: 26.7%;
--primary-color-1-lightness: 94.1%;
--primary-color-2: hsl(218.2, 26.8%, 92.0%);
--primary-color-2-hue: 218.2;
--primary-color-2-saturation: 26.8%;
--primary-color-2-lightness: 92.0%;
--primary-color-3: hsl(218.8, 27.9%, 88.0%);
--primary-color-3-hue: 218.8;
--primary-color-3-saturation: 27.9%;
--primary-color-3-lightness: 88.0%;
--primary-color-4: hsl(218.8, 18.3%, 81.8%);
--primary-color-4-hue: 218.8;
--primary-color-4-saturation: 18.3%;
--primary-color-4-lightness: 81.8%;
/* ---------- SECONDARY COLORS --------------- */
--secondary-color-1: hsl(220.0, 16.4%, 21.6%);
--secondary-color-1-hue: 220.0;
--secondary-color-1-saturation: 16.4%;
--secondary-color-1-lightness: 21.6%;
--secondary-color-2: hsl(221.7, 16.3%, 27.6%);
--secondary-color-2-hue: 221.7;
--secondary-color-2-saturation: 16.3%;
--secondary-color-2-lightness: 27.6%;
--secondary-color-3: hsl(220.0, 16.8%, 31.6%);
--secondary-color-3-hue: 220.0;
--secondary-color-3-saturation: 16.8%;
--secondary-color-3-lightness: 31.6%;
--secondary-color-4: hsl(220.0, 16.5%, 35.7%);
--secondary-color-4-hue: 220.0;
--secondary-color-4-saturation: 16.5%;
--secondary-color-4-lightness: 35.7%;
/* ----------- NUANCES COLORS ---------------- */
--theme-nuance-color-1: hsl(178.7, 25.1%, 64.9%);
--theme-nuance-color-1-hue: 178.7;
--theme-nuance-color-1-saturation: 25.1%;
--theme-nuance-color-1-lightness: 64.9%;
--theme-nuance-color-2: hsl(193.3, 43.4%, 67.5%);
--theme-nuance-color-2-hue: 193.3;
--theme-nuance-color-2-saturation: 43.4%;
--theme-nuance-color-2-lightness: 67.5%;
--theme-nuance-color-3: hsl(210.0, 34.0%, 63.1%);
--theme-nuance-color-3-hue: 210.0;
--theme-nuance-color-3-saturation: 34.0%;
--theme-nuance-color-3-lightness: 63.1%;
--theme-nuance-color-4: hsl(213.1, 32.0%, 52.2%);
--theme-nuance-color-4-hue: 213.1;
--theme-nuance-color-4-saturation: 32.0%;
--theme-nuance-color-4-lightness: 52.2%;
/* ----------- ROYGP COLORS ------------------ */
--theme-red-color: hsl(32.5, 80%, 50%);
--theme-orange-color: hsl(32.5, 70%, 45%);
--theme-yellow-color: hsl(40.0, 0.6%, 73.3%);
--theme-green-color: hsl(92.4, 27.8%, 64.7%);
--theme-purple-color: hsl(311.1, 20.2%, 63.1%);
/* ------------------------------------------- */
--background-color-1: var(--primary-color-1);
--background-color-2: var(--primary-color-2);
--background-color-3: var(--primary-color-3);
--background-color-4: var(--primary-color-4);
--border-color-1: var(--primary-color-2);
--border-color-2: var(--primary-color-3);
--border-color-3: var(--primary-color-4);
--border-focus-color: var(--theme-nuance-color-2);
--border-focus-shadow: var(--theme-nuance-color-1);
--text-color-plain: var(--secondary-color-1);
--text-color-subtile-1: var(--secondary-color-2);
--text-color-subtile-2: var(--secondary-color-3);
--code-background-color: var(--secondary-color-2);
--code-text-color: var(--primary-color-2);
--ui-range-thumb-color: var(--theme-nuance-color-3);
--ui-range-thumb-border: var(--ui-ranger-thumb-color);
--textarea-border-color: var(--secondary-color-4);
--chat-id-color: var(--theme-nuance-color-4);
/* ------------------------------------------- */
--button-alert-text-hover: var(--primary-color-1);
--button-alert-color-hover: var(--theme-orange-color);
--button-alert-border-hover: var(--theme-orange-color);
--button-alert-text-active: var(--primary-color-1);
--button-alert-color-active: var(--theme-red-color);
--button-alert-border-active: var(--theme-red-color);
/* ----------- PRIMARY BUTTONS --------------- */
/* - button should immediately catch the eye - */
--button-primary-text: var(--secondary-color-1);
--button-primary-color: var(--theme-nuance-color-3);
--button-primary-border: var(--theme-nuance-color-3);
/* ---------hover---------- */
--button-primary-text-hover:
hsl(217.5,
calc(var(--secondary-color-1-saturation) + 35%),
calc(var(--secondary-color-1-lightness) - 30%));
--button-primary-color-hover:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 2%),
calc(var(--theme-nuance-color-3-lightness) - 10%));
--button-primary-border-hover:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 2%),
calc(var(--theme-nuance-color-3-lightness) - 10%));
/* ---------active--------- */
--button-primary-text-active:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 20%),
calc(var(--theme-nuance-color-3-lightness) + 35%));
--button-primary-color-active:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 10%),
calc(var(--theme-nuance-color-3-lightness) - 25%));
--button-primary-border-active:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 10%),
calc(var(--theme-nuance-color-3-lightness) - 25%));
/* ---------- SECONDARY BUTTONS -------------- */
/* these should NOT immediately catch the eye */
--button-secondary-text:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 20%),
calc(var(--theme-nuance-color-3-lightness) - 50%));
--button-secondary-color:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 20%),
calc(var(--theme-nuance-color-3-lightness) + 10%));
--button-secondary-border:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 20%),
calc(var(--theme-nuance-color-3-lightness) + 10%));
/* ---------hover---------- */
--button-secondary-text-hover:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 20%),
calc(var(--theme-nuance-color-3-lightness) - 80%));
--button-secondary-color-hover:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 22%),
calc(var(--theme-nuance-color-3-lightness) + 1%));
--button-secondary-border-hover:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 22%),
calc(var(--theme-nuance-color-3-lightness) + 1%));
/* ---------active--------- */
--button-secondary-text-active:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) + 40%),
calc(var(--theme-nuance-color-3-lightness) - 55%));
--button-secondary-color-active:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 30%),
calc(var(--theme-nuance-color-3-lightness) - 5%));
--button-secondary-border-active:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 30%),
calc(var(--theme-nuance-color-3-lightness) - 5%));
/* ---------- TERTIARY BUTTONS --------------- */
/* ---------- disabled buttons --------------- */
--button-tertiary-text:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 40%),
calc(var(--theme-nuance-color-3-lightness) - 5%));
--button-tertiary-color:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 40%),
calc(var(--theme-nuance-color-3-lightness) + 20%));
--button-tertiary-border:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 40%),
calc(var(--theme-nuance-color-3-lightness) + 20%));
/* ---------hover---------- */
--button-tertiary-text-hover:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 40%),
calc(var(--theme-nuance-color-3-lightness) - 5%));
--button-tertiary-color-hover:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 40%),
calc(var(--theme-nuance-color-3-lightness) + 20%));
--button-tertiary-border-hover:
hsl(210,
calc(var(--theme-nuance-color-3-saturation) - 40%),
calc(var(--theme-nuance-color-3-lightness) + 20%));
}
/*
.theme-template {
If light theme: should go from bright to darker
If dark theme: should go from dark to brighter
ideally this should not be anything but steps of
gray or slightly variants from it
--primary-color-1: #2E3440;
--primary-color-2: #3B4252;
--primary-color-3: #434C5E;
--primary-color-4: #4C566A;
If light theme: should go from dark to brighter
If dark theme: should go from bright to darker
ideally this should not be anything but steps of
gray or slightly variants from it
--secondary-color-1: #ECEFF4;
--secondary-color-2: #E5E9F0;
--secondary-color-3: #D8DEE9;
--secondary-color-4: #C8CED9;
Choose wisely nuance colors. It is not easy to find
4 harmonizing nuance colors. But keep in mind, that
only one accent color could work too.
--theme-nuance-color-1: #8FBCBB;
--theme-nuance-color-2: #88C0D0;
--theme-nuance-color-3: #81A1C1;
--theme-nuance-color-4: #5E81AC;
adapt the color red, orange, yellow, green,
purple to the 'mood' of your overall design
e.g is it low-contrast? vibrant? dynamic? etc
--theme-red-color: #BF616A;
--theme-orange-color: #D08770;
--theme-yellow-color: #EBCB8B;
--theme-green-color: #A3BE8C;
--theme-purple-color: #B48EAD;
NOTE: comment all those line `--- ...` out
------------------------------------------------
--background-color-1:
--background-color-2:
--background-color-3:
--background-color-4:
--border-color-1:
--border-color-2:
--border-color-3:
--border-focus-color:
--border-focus-shadow:
--text-color-plain:
--text-color-subtile-1:
--text-color-subtile-2:
--code-background-color:
--code-text-color:
--ui-range-thumb-color:
--ui-range-thumb-border:
--textarea-border-color:
-------------------------------------------
--button-alert-text-hover:
--button-alert-color-hover:
--button-alert-border-hover:
--button-alert-text-active:
--button-alert-color-active:
--button-alert-border-active:
----------- PRIMARY -----------------------
--button should immediately catch the eye--
--button-primary-text:
--button-primary-color:
--button-primary-border:
---------hover----------
--button-primary-text-hover:
--button-primary-color-hover:
--button-primary-border-hover:
---------active---------
--button-primary-text-active:
--button-primary-color-active:
--button-primary-border-active:
------------ SECONDARY ------------------------
--button should NOT immediately catch the eye--
--button-secondary-text:
--button-secondary-color:
--button-secondary-border:
---------hover----------
--button-secondary-text-hover:
--button-secondary-color-hover:
--button-secondary-border-hover:
---------active---------
--button-secondary-text-active:
--button-secondary-color-active:
--button-secondary-border-active:
---------- TERTIARY -----------------------
---------- disabled buttons ---------------
--button-tertiary-text:
--button-tertiary-color:
--button-tertiary-border:
---------hover----------
--button-tertiary-text:
--button-tertiary-color:
--button-tertiary-border:
}
*/

View file

@ -1,10 +1,6 @@
@import url("theme-playground.css"); /* Author: Yazan Agha-Schrader */
@import url("theme-polarnight.css");
@import url("theme-snowstorm.css");
@import url("theme-beeninorder.css");
@import url("theme-mangotango.css");
:root { .theme-ketivah {
/* ---------- PRIMARY COLORS ----------------- */ /* ---------- PRIMARY COLORS ----------------- */
--primary-color-1: hsl(0, 0%, 99.2%); --primary-color-1: hsl(0, 0%, 99.2%);
@ -203,152 +199,3 @@
--loading-color-1: #eeeeee00; --loading-color-1: #eeeeee00;
--loading-color-2: #eeeeeeff; --loading-color-2: #eeeeeeff;
} }
/*
.theme-template {
If light theme: should go from bright to darker
If dark theme: should go from dark to brighter
ideally this should not be anything but steps of
gray or slightly variants from it
--primary-color-1: #2E3440;
--primary-color-2: #3B4252;
--primary-color-3: #434C5E;
--primary-color-4: #4C566A;
If light theme: should go from dark to brighter
If dark theme: should go from bright to darker
ideally this should not be anything but steps of
gray or slightly variants from it
--secondary-color-1: #ECEFF4;
--secondary-color-2: #E5E9F0;
--secondary-color-3: #D8DEE9;
--secondary-color-4: #C8CED9;
Choose wisely nuance colors. It is not easy to find
4 harmonizing nuance colors. But keep in mind, that
only one accent color could work too.
--theme-nuance-color-1: #8FBCBB;
--theme-nuance-color-2: #88C0D0;
--theme-nuance-color-3: #81A1C1;
--theme-nuance-color-4: #5E81AC;
adapt the color red, orange, yellow, green,
purple to the 'mood' of your overall design
e.g is it low-contrast? vibrant? dynamic? etc
--theme-red-color: #BF616A;
--theme-orange-color: #D08770;
--theme-yellow-color: #EBCB8B;
--theme-green-color: #A3BE8C;
--theme-purple-color: #B48EAD;
NOTE: comment all those line `--- ...` out
------------------------------------------------
--background-color-1:
--background-color-2:
--background-color-3:
--background-color-4:
--border-color-1:
--border-color-2:
--border-color-3:
--border-focus-color:
--border-focus-shadow:
--text-color-plain:
--text-color-subtile-1:
--text-color-subtile-2:
--code-background-color:
--code-text-color:
--ui-range-thumb-color:
--ui-range-thumb-border:
--textarea-border-color:
-------------------------------------------
--button-alert-text-hover:
--button-alert-color-hover:
--button-alert-border-hover:
--button-alert-text-active:
--button-alert-color-active:
--button-alert-border-active:
----------- PRIMARY -----------------------
--button should immediately catch the eye--
--button-primary-text:
--button-primary-color:
--button-primary-border:
---------hover----------
--button-primary-text-hover:
--button-primary-color-hover:
--button-primary-border-hover:
---------active---------
--button-primary-text-active:
--button-primary-color-active:
--button-primary-border-active:
------------ SECONDARY ------------------------
--button should NOT immediately catch the eye--
--button-secondary-text:
--button-secondary-color:
--button-secondary-border:
---------hover----------
--button-secondary-text-hover:
--button-secondary-color-hover:
--button-secondary-border-hover:
---------active---------
--button-secondary-text-active:
--button-secondary-color-active:
--button-secondary-border-active:
---------- TERTIARY -----------------------
---------- disabled buttons ---------------
--button-tertiary-text:
--button-tertiary-color:
--button-tertiary-border:
---------hover----------
--button-tertiary-text:
--button-tertiary-color:
--button-tertiary-border:
}
*/

View file

@ -8,6 +8,7 @@
<meta name="color-scheme" content="light dark"> <meta name="color-scheme" content="light dark">
<title>llama.cpp - chat</title> <title>llama.cpp - chat</title>
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="style.css">
<script type="module"> <script type="module">
@ -752,7 +753,7 @@ return html`
</fieldset> </fieldset>
${PromptControlFieldSet()} ${PromptControlFieldSet()}
<fieldset> <fieldset>
<details open> <details>
<summary><span class="summary-title" id="id_prompt-style">Prompt Style</span></summary> <summary><span class="summary-title" id="id_prompt-style">Prompt Style</span></summary>
<fieldset class="names"> <fieldset class="names">
<div> <div>
@ -1066,11 +1067,12 @@ return html`
<div class="dropdown"> <div class="dropdown">
<button class="dropbtn"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10" stroke-width="2"/></svg></button> <button class="dropbtn"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10" stroke-width="2"/></svg></button>
<div class="dropdown-content" id="theme-selector"> <div class="dropdown-content" id="theme-selector">
<a href="#" data-theme="default">Ketivah</a> <!-- <a href="index.html">Old UI</a> -->
<a href="#" data-theme="default">Snow Storm</a>
<a href="#" data-theme="polarnight">Polar Night</a>
<a href="#" data-theme="ketivah">Ketivah</a>
<a href="#" data-theme="mangotango">Mango Tango</a> <a href="#" data-theme="mangotango">Mango Tango</a>
<a href="#" data-theme="playground">Playground</a> <a href="#" data-theme="playground">Playground</a>
<a href="#" data-theme="polarnight">Polar Night</a>
<a href="#" data-theme="snowstorm">Snow Storm</a>
<a href="#" data-theme="beeninorder">Been In Order</a> <a href="#" data-theme="beeninorder">Been In Order</a>
</div> </div>
</div> </div>
@ -1104,7 +1106,7 @@ return html`
}); });
function changeTheme(theme) { function changeTheme(theme) {
document.body.classList.remove('theme-default', 'theme-mangotango', 'theme-playground', 'theme-polarnight', 'theme-snowstorm', 'theme-beeninorder'); document.body.classList.remove('theme-default', 'theme-polarnight', 'theme-ketivah', 'theme-mangotango', 'theme-playground', 'theme-beeninorder');
if (theme !== 'default') { if (theme !== 'default') {
document.body.classList.add('theme-' + theme); document.body.classList.add('theme-' + theme);
} }

View file

@ -1,331 +1,331 @@
// extended list // extended list
export const promptFormats = { export const promptFormats = {
"alpaca": { "alpaca": {
template: `{{prompt}}\n\n{{history}}\n\n{{char}}:`, template: `{{prompt}}\n\n{{history}}\n\n{{char}}:`,
historyTemplate: `### {{name}}:\n{{message}}`, historyTemplate: `### {{name}}:\n{{message}}`,
char: "Response", char: "Response",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "", charMsgSuffix: "",
user: "Instruction", user: "Instruction",
userMsgPrefix: "", userMsgPrefix: "",
userMsgSuffix: "", userMsgSuffix: "",
stops: "" stops: ""
}, },
// ---------------------------- // ----------------------------
"chatml": { "chatml": {
template: `<|im_start|>system\n{{prompt}}<|im_end|>\n{{history}}{{char}}`, template: `<|im_start|>system\n{{prompt}}<|im_end|>\n{{history}}{{char}}`,
historyTemplate: `<|im_start|>{{name}}\n{{message}}`, historyTemplate: `<|im_start|>{{name}}\n{{message}}`,
char: "assistant", char: "assistant",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "", charMsgSuffix: "",
user: "user", user: "user",
userMsgPrefix: "", userMsgPrefix: "",
userMsgSuffix: "<|im_end|>\n", userMsgSuffix: "<|im_end|>\n",
stops: "" stops: ""
}, },
// ---------------------------- // ----------------------------
"commandr": { "commandr": {
template: `<BOS_TOKEN><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{prompt}}\n<|END_OF_TURN_TOKEN|>{{history}}{{char}}`, template: `<BOS_TOKEN><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{prompt}}\n<|END_OF_TURN_TOKEN|>{{history}}{{char}}`,
historyTemplate: `<|START_OF_TURN_TOKEN|><|{{name}}|> {{message}}`, historyTemplate: `<|START_OF_TURN_TOKEN|><|{{name}}|> {{message}}`,
char: "CHATBOT_TOKEN", char: "CHATBOT_TOKEN",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "", charMsgSuffix: "",
user: "User", user: "USER_TOKEN",
userMsgPrefix: "", userMsgPrefix: "",
userMsgSuffix: "<|END_OF_TURN_TOKEN|>", userMsgSuffix: "<|END_OF_TURN_TOKEN|>",
stops: "" stops: ""
}, },
// ref: https://docs.cohere.com/docs/prompting-command-r // ref: https://docs.cohere.com/docs/prompting-command-r
// ---------------------------- // ----------------------------
"llama2": { "llama2": {
template: `<s>[INST] <<SYS>>\n{{prompt}}\n<</SYS>>\n\nTest Message [/INST] Test Successfull </s>{{history}}{{char}}`, template: `<s>[INST] <<SYS>>\n{{prompt}}\n<</SYS>>\n\nTest Message [/INST] Test Successfull </s>{{history}}{{char}}`,
historyTemplate: `{{name}}: {{message}}`, historyTemplate: `{{name}}: {{message}}`,
char: "Assistant", char: "Assistant",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "</s>", charMsgSuffix: "</s>",
user: "User", user: "User",
userMsgPrefix: "<s>[INST] ", userMsgPrefix: "<s>[INST] ",
userMsgSuffix: " [/INST]", userMsgSuffix: " [/INST]",
stops: "" stops: ""
}, },
// ref: https://huggingface.co/blog/llama2#how-to-prompt-llama-2 // ref: https://huggingface.co/blog/llama2#how-to-prompt-llama-2
// ---------------------------- // ----------------------------
"llama3": { "llama3": {
template: `<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\n{{prompt}}{{history}}{{char}}`, template: `<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\n{{prompt}}{{history}}{{char}}`,
historyTemplate: `<|start_header_id|>{{name}}<|end_header_id|>\n\n{{message}}<|eot_id|>`, historyTemplate: `<|start_header_id|>{{name}}<|end_header_id|>\n\n{{message}}<|eot_id|>`,
char: "assistant", char: "assistant",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "", charMsgSuffix: "",
user: "user", user: "user",
userMsgPrefix: "", userMsgPrefix: "",
userMsgSuffix: "", userMsgSuffix: "",
stops: "<|eot_id|>" stops: "<|eot_id|>"
}, },
// ref: https://llama.meta.com/docs/model-cards-and-prompt-formats/meta-llama-3/#special-tokens-used-with-meta-llama-3 // ref: https://llama.meta.com/docs/model-cards-and-prompt-formats/meta-llama-3/#special-tokens-used-with-meta-llama-3
// ---------------------------- // ----------------------------
"openchat": { "openchat": {
template: `{{history}}{{char}}`, template: `{{history}}{{char}}`,
historyTemplate: `GPT4 Correct {{name}}: {{message}}<|end_of_turn|>`, historyTemplate: `GPT4 Correct {{name}}: {{message}}<|end_of_turn|>`,
char: "Assistant", char: "Assistant",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "", charMsgSuffix: "",
user: "User", user: "User",
userMsgPrefix: "", userMsgPrefix: "",
userMsgSuffix: "", userMsgSuffix: "",
stops: "" stops: ""
}, },
// ---------------------------- // ----------------------------
"phi3": { "phi3": {
template: `{{history}}{{char}}`, template: `{{history}}{{char}}`,
historyTemplate: `<|{{name}}|>\n{{message}}<|end|>\n`, historyTemplate: `<|{{name}}|>\n{{message}}<|end|>\n`,
char: "assistant", char: "assistant",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "", charMsgSuffix: "",
user: "user", user: "user",
userMsgPrefix: "", userMsgPrefix: "",
userMsgSuffix: "", userMsgSuffix: "",
stops: "<|end|>" stops: "<|end|>"
}, },
// ref: https://huggingface.co/microsoft/Phi-3-mini-4k-instruct#chat-format // ref: https://huggingface.co/microsoft/Phi-3-mini-4k-instruct#chat-format
// ---------------------------- // ----------------------------
"vicuna": { "vicuna": {
template: `{{prompt}}\n{{history}}{{char}}`, template: `{{prompt}}\n{{history}}{{char}}`,
historyTemplate: `{{name}}: {{message}}\n`, historyTemplate: `{{name}}: {{message}}\n`,
char: "ASSISTANT", char: "ASSISTANT",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "", charMsgSuffix: "",
user: "USER", user: "USER",
userMsgPrefix: "", userMsgPrefix: "",
userMsgSuffix: "", userMsgSuffix: "",
stops: "" stops: ""
}, },
// ref: https://huggingface.co/lmsys/vicuna-33b-v1.3/discussions/1 // ref: https://huggingface.co/lmsys/vicuna-33b-v1.3/discussions/1
// ---------------------------- // ----------------------------
"deepseekCoder": { "deepseekCoder": {
template: `{{prompt}}{{history}}{{char}}:`, template: `{{prompt}}{{history}}{{char}}:`,
historyTemplate: `### {{name}}:\n{{message}}`, historyTemplate: `### {{name}}:\n{{message}}`,
char: "Response", char: "Response",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "", charMsgSuffix: "",
user: "Instruction", user: "Instruction",
userMsgPrefix: "", userMsgPrefix: "",
userMsgSuffix: "", userMsgSuffix: "",
stops: "<|EOT|>" stops: "<|EOT|>"
}, },
// ---------------------------- // ----------------------------
"med42": { "med42": {
template: `<|system|>: {{prompt}}\n{{history}}{{char}}`, template: `<|system|>: {{prompt}}\n{{history}}{{char}}`,
historyTemplate: `<|{{name}}|>: {{message}}\n`, historyTemplate: `<|{{name}}|>: {{message}}\n`,
char: "assistant", char: "assistant",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "", charMsgSuffix: "",
user: "prompter", user: "prompter",
userMsgPrefix: "", userMsgPrefix: "",
userMsgSuffix: "", userMsgSuffix: "",
stops: "" stops: ""
}, },
// ---------------------------- // ----------------------------
"neuralchat": { "neuralchat": {
template: `### System:\n{{prompt}}\n{{history}}{{char}}:`, template: `### System:\n{{prompt}}\n{{history}}{{char}}:`,
historyTemplate: `### {{name}}:\n{{message}}\n`, historyTemplate: `### {{name}}:\n{{message}}\n`,
char: "Assistant", char: "Assistant",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "", charMsgSuffix: "",
user: "User", user: "User",
userMsgPrefix: "", userMsgPrefix: "",
userMsgSuffix: "", userMsgSuffix: "",
stops: "" stops: ""
}, },
// ---------------------------- // ----------------------------
"nousHermes": { "nousHermes": {
template: `### Instruction: {{prompt}}\n\n{{history}}\n\n{{char}}:`, template: `### Instruction: {{prompt}}\n\n{{history}}\n\n{{char}}:`,
historyTemplate: `### {{name}}:\n{{message}}`, historyTemplate: `### {{name}}:\n{{message}}`,
char: "Response", char: "Response",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "", charMsgSuffix: "",
user: "Input", user: "Input",
userMsgPrefix: "", userMsgPrefix: "",
userMsgSuffix: "", userMsgSuffix: "",
stops: "" stops: ""
}, },
// ---------------------------- // ----------------------------
"openchatMath": { "openchatMath": {
template: `{{history}}{{char}}`, template: `{{history}}{{char}}`,
historyTemplate: `Math Correct {{name}}: {{message}}<|end_of_turn|>`, historyTemplate: `Math Correct {{name}}: {{message}}<|end_of_turn|>`,
char: "Assistant", char: "Assistant",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "", charMsgSuffix: "",
user: "User", user: "User",
userMsgPrefix: "", userMsgPrefix: "",
userMsgSuffix: "", userMsgSuffix: "",
stops: "" stops: ""
}, },
// ---------------------------- // ----------------------------
"orion": { "orion": {
template: `<s>Human: Test Message\n\nAssistant: </s>Test Successful</s>{{history}}{{char}}:`, template: `<s>Human: Test Message\n\nAssistant: </s>Test Successful</s>{{history}}{{char}}:`,
historyTemplate: `{{name}}: {{message}}`, historyTemplate: `{{name}}: {{message}}`,
char: "Assistant </s>", char: "Assistant </s>",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "", charMsgSuffix: "",
user: "Human", user: "Human",
userMsgPrefix: "", userMsgPrefix: "",
userMsgSuffix: "\n\n", userMsgSuffix: "\n\n",
stops: "" stops: ""
}, },
// ---------------------------- // ----------------------------
"sauerkraut": { "sauerkraut": {
template: `{{prompt}}\n{{history}}{{char}}`, template: `{{prompt}}\n{{history}}{{char}}`,
historyTemplate: ` historyTemplate: `
{{name}}: {{message}}\n`, {{name}}: {{message}}\n`,
char: "Assistant", char: "Assistant",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "", charMsgSuffix: "",
user: "User", user: "User",
userMsgPrefix: "", userMsgPrefix: "",
userMsgSuffix: "", userMsgSuffix: "",
stops: "" stops: ""
}, },
// ---------------------------- // ----------------------------
"starlingCode": { "starlingCode": {
template: `{{history}}{{char}}`, template: `{{history}}{{char}}`,
historyTemplate: `Code {{name}}: {{message}}<|end_of_turn|>`, historyTemplate: `Code {{name}}: {{message}}<|end_of_turn|>`,
char: "Assistant", char: "Assistant",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "", charMsgSuffix: "",
user: "User", user: "User",
userMsgPrefix: "", userMsgPrefix: "",
userMsgSuffix: "", userMsgSuffix: "",
stops: "" stops: ""
}, },
// ---------------------------- // ----------------------------
"yi34b": { "yi34b": {
template: `{{history}} {{char}}`, template: `{{history}} {{char}}`,
historyTemplate: `{{name}}: {{message}}`, historyTemplate: `{{name}}: {{message}}`,
char: "Assistant", char: "Assistant",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "", charMsgSuffix: "",
user: "Human", user: "Human",
userMsgPrefix: "", userMsgPrefix: "",
userMsgSuffix: "", userMsgSuffix: "",
stops: "" stops: ""
}, },
// ---------------------------- // ----------------------------
"zephyr": { "zephyr": {
template: `<|system|>\n{{prompt}}</s>\n{{history}}{{char}}`, template: `<|system|>\n{{prompt}}</s>\n{{history}}{{char}}`,
historyTemplate: `<|{{name}}|>\n{{message}}</s>\n`, historyTemplate: `<|{{name}}|>\n{{message}}</s>\n`,
char: "assistant", char: "assistant",
charMsgPrefix: "", charMsgPrefix: "",
charMsgSuffix: "", charMsgSuffix: "",
user: "user", user: "user",
userMsgPrefix: "", userMsgPrefix: "",
userMsgSuffix: "", userMsgSuffix: "",
stops: "" stops: ""
} }
}; };