From 391c067250befdbadba37d3d4577322fa274dd8a Mon Sep 17 00:00:00 2001 From: josc146 Date: Fri, 2 Jun 2023 23:53:25 +0800 Subject: [PATCH] add Instruction to Completion Presets --- frontend/src/_locales/zh-hans/main.json | 1 + frontend/src/pages/Completion.tsx | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/frontend/src/_locales/zh-hans/main.json b/frontend/src/_locales/zh-hans/main.json index 99761b2..607035c 100644 --- a/frontend/src/_locales/zh-hans/main.json +++ b/frontend/src/_locales/zh-hans/main.json @@ -114,6 +114,7 @@ "Catgirl": "猫娘", "Explain Code": "代码解释", "Werewolf": "狼人杀", + "Instruction": "指令", "Blank": "空白", "The following is an epic science fiction masterpiece that is immortalized, with delicate descriptions and grand depictions of interstellar civilization wars.\nChapter 1.\n": "以下是不朽的科幻史诗巨著,描写细腻,刻画了宏大的星际文明战争。\n第一章\n", "The following is a conversation between a cat girl and her owner. The cat girl is a humanized creature that behaves like a cat but is humanoid. At the end of each sentence in the dialogue, she will add \"Meow~\". In the following content, Bob represents the owner and Alice represents the cat girl.\n\nBob: Hello.\n\nAlice: I'm here, meow~.\n\nBob: Can you tell jokes?": "以下是一位猫娘的主人和猫娘的对话内容,猫娘是一种拟人化的生物,其行为似猫但类人,在每一句对话末尾都会加上\"喵~\"。以下内容中,Bob代表主人,Alice代表猫娘。\n\nBob: 你好\n\nAlice: 主人我在哦,喵~\n\nBob: 你会讲笑话吗?", diff --git a/frontend/src/pages/Completion.tsx b/frontend/src/pages/Completion.tsx index 0955e2c..4256a55 100644 --- a/frontend/src/pages/Completion.tsx +++ b/frontend/src/pages/Completion.tsx @@ -101,6 +101,19 @@ export const defaultPresets: CompletionPreset[] = [{ injectStart: '\\n\\nAlice: ', injectEnd: '\\n\\nBob: ' } +}, { + name: 'Instruction', + prompt: 'Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n# Instruction:\nExplain the following metaphor: Life is like cats.\n\n# Response:\n', + params: { + maxResponseToken: 500, + temperature: 1.2, + topP: 0.5, + presencePenalty: 0.4, + frequencyPenalty: 0.4, + stop: '', + injectStart: '', + injectEnd: '' + } }, { name: 'Blank', prompt: '',