From f50bd5c5ba62d36056e38d072675fbbd9e42a738 Mon Sep 17 00:00:00 2001 From: mgroeber9110 Date: Thu, 27 Jun 2024 22:57:08 +0200 Subject: [PATCH] server : fix templates for llama2, llama3 and zephyr --- examples/server/public/prompt-formats.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/server/public/prompt-formats.js b/examples/server/public/prompt-formats.js index 73ddb7187..bdb23e654 100644 --- a/examples/server/public/prompt-formats.js +++ b/examples/server/public/prompt-formats.js @@ -56,9 +56,9 @@ export const promptFormats = { // ---------------------------- "llama2": { - template: `[INST] <>\n{{prompt}}\n<>\n\nTest Message [/INST] Test Successfull {{history}}{{char}}`, + template: `[INST] <>\n{{prompt}}\n<>\n\nTest Message [/INST] Test Successful {{history}}`, - historyTemplate: `{{name}}: {{message}}`, + historyTemplate: `{{message}}`, char: "Assistant", charMsgPrefix: "", @@ -75,9 +75,9 @@ export const promptFormats = { // ---------------------------- "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}}<|eot_id|>\n{{history}}<|start_header_id|>{{char}}<|end_header_id|>\n\n`, - 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|>\n`, char: "assistant", charMsgPrefix: "", @@ -314,7 +314,7 @@ export const promptFormats = { // ---------------------------- "zephyr": { - template: `<|system|>\n{{prompt}}\n{{history}}{{char}}`, + template: `<|system|>\n{{prompt}}\n{{history}}<|{{char}}|>\n`, historyTemplate: `<|{{name}}|>\n{{message}}\n`, @@ -328,4 +328,6 @@ export const promptFormats = { stops: "" } + // ref: https://huggingface.co/HuggingFaceH4/zephyr-7b-alpha + };