fix chatml & add llama3 format

This commit is contained in:
Yazan Agha-Schrader 2024-05-29 11:26:34 +02:00
parent 5fa255edfb
commit 9fa0aa53f5
2 changed files with 346 additions and 329 deletions

View file

@ -660,6 +660,7 @@ const BoolField = ({ label, title, name, value }) => {
<option value="alpaca">Alpaca</option> <option value="alpaca">Alpaca</option>
<option value="chatml">ChatML</option> <option value="chatml">ChatML</option>
<option value="llama2">Llama 2</option> <option value="llama2">Llama 2</option>
<option value="llama3">Llama 3</option>
<option value="phi3">Phi-3</option> <option value="phi3">Phi-3</option>
<option value="vicuna">Vicuna</option> <option value="vicuna">Vicuna</option>
<option value=""></option> <option value=""></option>
@ -733,11 +734,11 @@ const BoolField = ({ label, title, name, value }) => {
${PromptControlFieldSet()} ${PromptControlFieldSet()}
<fieldset class="names"> <fieldset class="names">
<div> <div>
<label for="user" id="id_user-name">User Name</label> <label for="user" id="id_user-name">User ID Token</label>
<input type="text" id="user" name="user" value="${session.value.user}" oninput=${updateSession} /> <input type="text" id="user" name="user" value="${session.value.user}" oninput=${updateSession} />
</div> </div>
<div> <div>
<label for="bot" id="id_bot-name">AI Name</label> <label for="bot" id="id_bot-name">AI ID Token</label>
<input type="text" id="bot" name="char" value="${session.value.char}" oninput=${updateSession} /> <input type="text" id="bot" name="char" value="${session.value.char}" oninput=${updateSession} />
</div> </div>
</fieldset> </fieldset>

View file

@ -1,459 +1,475 @@
// extended list // extended list
export const promptFormats = { export const promptFormats = {
"airoborosl2": { "alpaca": {
template: `{{prompt}} {{history}} {{char}}`, template: `{{prompt}}
historyTemplate: `{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
{{history}}
### {{char}}:`,
historyTemplate: `### {{name}}:
{{message}}`,
char: "Response",
user: "Instruction"
},
"alpaca": {
template: `{{prompt}}
{{history}}
### {{char}}:`, "chatml": {
historyTemplate: `### {{name}}: template: `<|im_start|>system
{{message}}`, {{prompt}}<|im_end|>
char: "Response", {{history}}
user: "Instruction" {{char}}`,
}, historyTemplate: `{{name}}
{{message}}`,
char: "<|im_start|>assistant",
user: "<|im_start|>user",
userMsgSuffix: "<|im_end|>"
},
"bakllava": { "llama2": {
template: `{{history}}{{char}}:`, template: `<s>[INST] <<SYS>>
historyTemplate: `{{name}}: {{message}} {{prompt}}
`, <</SYS>>
char: "ASSISTANT",
user: "USER"
},
{{history}} [/INST] {{char}} </s><s>[INST] `,
historyTemplate: `{{name}}: {{message}} [/INST]`,
char: "llama",
user: "user",
userMsgSuffix: ""
},
"chatml": {
template: `<|im_start|>system
{{prompt}}<|im_end|>
{{history}}
<|im_start|>{{char}}`,
historyTemplate: `<|im_start|>{{user}}
{{message}}<|im_end|>`,
char: "assistant",
user: "user"
},
"llama3": {
template: `<|begin_of_text|><|start_header_id|>system<|end_header_id|>
{{prompt}}<|eot_id|>{{history}}{{char}}`,
historyTemplate: `<|start_header_id|>{{name}}<|end_header_id|>
"codeCherryPop": { {{message}}`,
template: `{{prompt}} char: "assistant",
user: "user",
userMsgSuffix: "<|eot_id|>"
},
{{history}}
### {{char}}:`,
historyTemplate: `### {{name}}:
{{message}}`,
char: "Response",
user: "Instruction"
},
"phi3": {
template: `{{history}}
{{char}}
`,
historyTemplate: `{{name}}
{{message}}`,
char: "<|assistant|>",
user: "<|user|>",
userMsgSuffix: "<|end|>"
},
"deepseekCoder": {
template: `{{prompt}}
{{history}}
### {{char}}:`,
historyTemplate: `### {{name}}:
{{message}}`,
char: "Response",
user: "Instruction"
},
"airoborosl2": {
template: `{{prompt}} {{history}} {{char}}`,
historyTemplate: `{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"dolphinMistral": {
template: `<|im_start|>system
{{prompt}}<|im_end|>
{{history}}
<|im_start|>{{char}}`,
historyTemplate: `<|im_start|>{{user}}
{{message}}<|im_end|>`,
char: "assistant",
user: "user"
},
"bakllava": {
template: `{{history}}{{char}}:`,
historyTemplate: `{{name}}: {{message}}
`,
char: "ASSISTANT",
user: "USER"
},
"evolvedSeeker": {
template: `<|im_start|>system
{{prompt}}<|im_end|>
{{history}}
<|im_start|>{{char}}`,
historyTemplate: `<|im_start|>{{user}}
{{message}}<|im_end|>`,
char: "assistant",
user: "user"
},
"codeCherryPop": {
template: `{{prompt}}
{{history}}
"goliath120b": { ### {{char}}:`,
template: `{{prompt}} historyTemplate: `### {{name}}:
{{message}}`,
char: "Response",
user: "Instruction"
},
{{history}}
{{char}}:`,
historyTemplate: `{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"deepseekCoder": {
template: `{{prompt}}
{{history}}
### {{char}}:`,
historyTemplate: `### {{name}}:
{{message}}`,
char: "Response",
user: "Instruction"
},
"jordan": {
template: `{{prompt}}
{{history}}
{{char}}:`,
historyTemplate: `{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"dolphinMistral": {
template: `<|im_start|>system
{{prompt}}<|im_end|>
{{history}}
<|im_start|>{{char}}`,
historyTemplate: `<|im_start|>{{user}}
{{message}}<|im_end|>`,
char: "assistant",
user: "user"
},
"llama2": {
template: `<s>[INST] <<SYS>>
{{prompt}}
<</SYS>>
{{history}} [/INST] {{char}} </s><s>[INST] `, "evolvedSeeker": {
historyTemplate: `{{name}}: {{message}} [/INST]`, template: `<|im_start|>system
char: "llama", {{prompt}}<|im_end|>
user: "user" {{history}}
}, <|im_start|>{{char}}`,
historyTemplate: `<|im_start|>{{user}}
{{message}}<|im_end|>`,
char: "assistant",
user: "user"
},
"llava": { "goliath120b": {
template: `{{history}}{{char}}:`, template: `{{prompt}}
historyTemplate: `{{name}}: {{message}}
`,
char: "ASSISTANT",
user: "USER"
},
{{history}}
{{char}}:`,
historyTemplate: `{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"leoHessianai": {
template: `<|im_start|>system
{{prompt}}<|im_end|>
{{history}}
<|im_start|>{{char}}`,
historyTemplate: `<|im_start|>{{user}}
{{message}}<|im_end|>`,
char: "assistant",
user: "user"
},
"jordan": {
template: `{{prompt}}
{{history}}
{{char}}:`,
historyTemplate: `{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"leoMistral": {
template: `{{prompt}} {{history}} {{char}}`,
historyTemplate: `{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"llava": {
template: `{{history}}{{char}}:`,
historyTemplate: `{{name}}: {{message}}
`,
char: "ASSISTANT",
user: "USER"
},
"marx": {
template: `{{history}}
{{char}}:`,
historyTemplate: `{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"leoHessianai": {
template: `<|im_start|>system
{{prompt}}<|im_end|>
{{history}}
<|im_start|>{{char}}`,
historyTemplate: `<|im_start|>{{user}}
{{message}}<|im_end|>`,
char: "assistant",
user: "user"
},
"med42": {
template: `<|system|>: {{prompt}}
{{history}}
{{char}}`,
historyTemplate: `<|{{name}}|>:{{message}}`,
char: "assistant",
user: "prompter"
},
"leoMistral": {
template: `{{prompt}} {{history}} {{char}}`,
historyTemplate: `{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"metaMath": {
template: `{{prompt}}
{{history}}
### {{char}}:`, "marx": {
historyTemplate: `### {{name}}: template: `{{history}}
{{message}}`, {{char}}:`,
char: "Response", historyTemplate: `{{name}}: {{message}}`,
user: "Instruction" char: "ASSISTANT",
}, user: "USER"
},
"mistralInstruct": { "med42": {
template: `<s>[INST] ({{prompt}}) {{history}} {{char}}</s>`, template: `<|system|>: {{prompt}}
historyTemplate: `{{name}} {{message}}`, {{history}}
char: "[/INST] Assistant:", {{char}}`,
user: "[INST] User:" historyTemplate: `<|{{name}}|>:{{message}}`,
}, char: "assistant",
user: "prompter"
},
"mistralOpenOrca": { "metaMath": {
template: `<|im_start|>system template: `{{prompt}}
{{prompt}}<|im_end|>
{{history}}
<|im_start|>{{char}}`,
historyTemplate: `<|im_start|>{{user}}
{{message}}<|im_end|>`,
char: "assistant",
user: "user"
},
{{history}}
### {{char}}:`,
historyTemplate: `### {{name}}:
{{message}}`,
char: "Response",
user: "Instruction"
},
"mythomax": {
template: `{{prompt}}
{{history}}
### {{char}}:`, "mistralInstruct": {
historyTemplate: `### {{name}}: template: `<s>[INST] ({{prompt}}) {{history}} {{char}}</s>`,
{{message}}`, historyTemplate: `{{name}} {{message}}`,
char: "Response", char: "[/INST] Assistant:",
user: "Instruction" user: "[INST] User:"
}, },
"neuralchat": { "mistralOpenOrca": {
template: `### System: template: `<|im_start|>system
{{prompt}} {{prompt}}<|im_end|>
{{history}} {{history}}
### {{char}}:`, <|im_start|>{{char}}`,
historyTemplate: `### {{name}}: historyTemplate: `<|im_start|>{{user}}
{{message}}`, {{message}}<|im_end|>`,
char: "Assistant", char: "assistant",
user: "User" user: "user"
}, },
"nousCapybara": { "mythomax": {
template: `{{history}} template: `{{prompt}}
{{char}}`,
historyTemplate: `
{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
{{history}}
### {{char}}:`,
historyTemplate: `### {{name}}:
{{message}}`,
char: "Response",
user: "Instruction"
},
"nousHermes": {
template: `### Instruction: {{prompt}}
{{history}}
### {{char}}:`,
historyTemplate: `
### {{name}}: {{message}}`,
char: "Response",
user: "Input"
},
"neuralchat": {
template: `### System:
{{prompt}}
{{history}}
### {{char}}:`,
historyTemplate: `### {{name}}:
{{message}}`,
char: "Assistant",
user: "User"
},
"openChat": {
template: `{{history}}{{char}}`,
historyTemplate: `GPT4 {{user}}: {{message}}<|end_of_turn|>`,
char: "Assistant",
user: "User"
},
"nousCapybara": {
template: `{{history}}
{{char}}`,
historyTemplate: `
{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"openhermes2Mistral": {
template: `<|im_start|>system
{{prompt}}<|im_end|>
{{history}}
<|im_start|>{{char}}`,
historyTemplate: `<|im_start|>{{user}}
{{message}}<|im_end|>`,
char: "assistant",
user: "user"
},
"nousHermes": {
template: `### Instruction: {{prompt}}
{{history}}
### {{char}}:`,
historyTemplate: `
### {{name}}: {{message}}`,
char: "Response",
user: "Input"
},
"orcamini": {
template: `{{prompt}}
{{history}}
### {{char}}:`, "openChat": {
historyTemplate: `### {{name}}: template: `{{history}}{{char}}`,
{{message}}`, historyTemplate: `GPT4 {{user}}: {{message}}<|end_of_turn|>`,
char: "Response", char: "Assistant",
user: "Instruction" user: "User"
}, },
"phi3": { "openhermes2Mistral": {
template: `{{history}} template: `<|im_start|>system
{{char}} {{prompt}}<|im_end|>
`, {{history}}
historyTemplate: `{{name}} <|im_start|>{{char}}`,
{{message}}`, historyTemplate: `<|im_start|>{{user}}
char: "<|assistant|>", {{message}}<|im_end|>`,
user: "<|user|>", char: "assistant",
userMsgSuffix: "<|end|>" user: "user"
}, },
"sauerkraut": { "orcamini": {
template: `{{prompt}} template: `{{prompt}}
{{history}}
{{char}}:`,
historyTemplate: `{{name}}: {{message}}`,
char: "Assistant",
user: "User"
},
{{history}}
### {{char}}:`,
historyTemplate: `### {{name}}:
{{message}}`,
char: "Response",
user: "Instruction"
},
"samantha": {
template: `{{prompt}}
{{history}}
{{char}}:`,
historyTemplate: `{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"sauerkraut": {
template: `{{prompt}}
{{history}}
{{char}}:`,
historyTemplate: `{{name}}: {{message}}`,
char: "Assistant",
user: "User"
},
"samanthaMistral": {
template: `<|im_start|>system
{{prompt}}<|im_end|>
{{history}}
<|im_start|>{{char}}`,
historyTemplate: `<|im_start|>{{user}}
{{message}}<|im_end|>`,
char: "assistant",
user: "user"
},
"samantha": {
template: `{{prompt}}
{{history}}
{{char}}:`,
historyTemplate: `{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"scarlett": {
template: `{{prompt}}
{{history}}
{{char}}:`,
historyTemplate: `{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"samanthaMistral": {
template: `<|im_start|>system
{{prompt}}<|im_end|>
{{history}}
<|im_start|>{{char}}`,
historyTemplate: `<|im_start|>{{user}}
{{message}}<|im_end|>`,
char: "assistant",
user: "user"
},
"starlingLM": {
template: `{{history}}{{char}}`,
historyTemplate: `GPT4 Correct {{user}}: {{message}}<|end_of_turn|>`,
char: "Assistant",
user: "User"
},
"scarlett": {
template: `{{prompt}}
{{history}}
{{char}}:`,
historyTemplate: `{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"starlingLMCode": {
template: `{{history}}{{char}}`,
historyTemplate: `Code {{user}}: {{message}}<|end_of_turn|>`,
char: "Assistant",
user: "User"
},
"starlingLM": {
template: `{{history}}{{char}}`,
historyTemplate: `GPT4 Correct {{user}}: {{message}}<|end_of_turn|>`,
char: "Assistant",
user: "User"
},
"sydney": {
template: `{{prompt}}
{{history}}
{{char}}`,
historyTemplate: `### {{name}}:
{{message}}
`,
char: "Response",
user: "Instruction"
},
"starlingLMCode": {
template: `{{history}}{{char}}`,
historyTemplate: `Code {{user}}: {{message}}<|end_of_turn|>`,
char: "Assistant",
user: "User"
},
"synthia": {
template: `SYSTEM: {{prompt}}
{{history}}
{{char}}:`,
historyTemplate: `{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"sydney": {
template: `{{prompt}}
{{history}}
{{char}}`,
historyTemplate: `### {{name}}:
{{message}}
`,
char: "Response",
user: "Instruction"
},
"tess": {
template: `SYSTEM: {{prompt}}
{{history}}
{{char}}:`,
historyTemplate: `{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"synthia": {
template: `SYSTEM: {{prompt}}
{{history}}
{{char}}:`,
historyTemplate: `{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"vicuna": {
template: `{{prompt}}
{{history}}
{{char}}:`,
historyTemplate: `
{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"tess": {
template: `SYSTEM: {{prompt}}
{{history}}
{{char}}:`,
historyTemplate: `{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"yi34b": {
template: `{{history}} {{char}}`,
historyTemplate: `{{name}}: {{message}}`,
char: "Assistant",
user: "Human"
},
"vicuna": {
template: `{{prompt}}
{{history}}
{{char}}:`,
historyTemplate: `
{{name}}: {{message}}`,
char: "ASSISTANT",
user: "USER"
},
"zephyr": {
template: `<|system|>
{{prompt}}</s> "yi34b": {
{{history}} template: `{{history}} {{char}}`,
{{char}}`, historyTemplate: `{{name}}: {{message}}`,
historyTemplate: `<|{{name}}|> char: "Assistant",
{{message}}</s>`, user: "Human"
char: "assistant", },
user: "user"
}
};
"zephyr": {
template: `<|system|>
{{prompt}}</s>
{{history}}
{{char}}`,
historyTemplate: `<|{{name}}|>
{{message}}</s>`,
char: "assistant",
user: "user"
}
};