[feat] recommended button
This commit is contained in:
@@ -333,5 +333,6 @@ export const languageEnglish = {
|
|||||||
officialDiscord: "Official Discord",
|
officialDiscord: "Official Discord",
|
||||||
officialDiscordDesc: "Official Discord to talk about RisuAI",
|
officialDiscordDesc: "Official Discord to talk about RisuAI",
|
||||||
confirmRecommendedPreset: "There is a recommended settings for this model. do you want to change the settings to that? (you can turn off asking in the accessiblity settings)",
|
confirmRecommendedPreset: "There is a recommended settings for this model. do you want to change the settings to that? (you can turn off asking in the accessiblity settings)",
|
||||||
toggleConfirmRecommendedPreset: "Ask for recommended setting when model change"
|
toggleConfirmRecommendedPreset: "Ask for recommended setting when model change",
|
||||||
|
recommendedPreset: "Set to Recommended Settings"
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
import DropList from "src/lib/SideBars/DropList.svelte";
|
import DropList from "src/lib/SideBars/DropList.svelte";
|
||||||
import { PlusIcon, TrashIcon } from "lucide-svelte";
|
import { PlusIcon, TrashIcon } from "lucide-svelte";
|
||||||
import { onDestroy } from "svelte";
|
import { onDestroy } from "svelte";
|
||||||
import { setRecommended } from "src/ts/process/templates/getRecomended";
|
import { recommendedPresetExist, setRecommended } from "src/ts/process/templates/getRecomended";
|
||||||
let tokens = {
|
let tokens = {
|
||||||
mainPrompt: 0,
|
mainPrompt: 0,
|
||||||
jailbreak: 0,
|
jailbreak: 0,
|
||||||
@@ -61,9 +61,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{#if advancedBotSettings}
|
{#if advancedBotSettings}
|
||||||
<span class="text-neutral-200 mt-4">{language.model} <Help key="model"/></span>
|
<span class="text-neutral-200 mt-4">{language.model} <Help key="model"/></span>
|
||||||
<ModelList bind:value={$DataBase.aiModel} onChange={(v) => {
|
<ModelList bind:value={$DataBase.aiModel}/>
|
||||||
setRecommended(v, 'ask')
|
|
||||||
}}/>
|
|
||||||
|
|
||||||
<span class="text-neutral-200 mt-2">{language.submodel} <Help key="submodel"/></span>
|
<span class="text-neutral-200 mt-2">{language.submodel} <Help key="submodel"/></span>
|
||||||
<ModelList bind:value={$DataBase.subModel}/>
|
<ModelList bind:value={$DataBase.subModel}/>
|
||||||
@@ -94,6 +92,11 @@
|
|||||||
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
{#if advancedBotSettings && recommendedPresetExist($DataBase.aiModel)}
|
||||||
|
<div>
|
||||||
|
<button class="bg-darkbg hover:ring p-1 text-sm mb-2 rounded-md" on:click={() => {setRecommended($DataBase.aiModel, 'ask')}}>{language.recommendedPreset}</button>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
{#if $DataBase.aiModel === 'palm2' || $DataBase.subModel === 'palm2'}
|
{#if $DataBase.aiModel === 'palm2' || $DataBase.subModel === 'palm2'}
|
||||||
<span class="text-neutral-200">Palm2 {language.apiKey}</span>
|
<span class="text-neutral-200">Palm2 {language.apiKey}</span>
|
||||||
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" placeholder="..." bind:value={$DataBase.palmAPI}>
|
<input class="text-neutral-200 mb-4 p-2 bg-transparent input-text focus:bg-selected text-sm" placeholder="..." bind:value={$DataBase.palmAPI}>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { language } from "src/lang";
|
|||||||
|
|
||||||
export async function setRecommended(model: string, ask:'ask'|'force') {
|
export async function setRecommended(model: string, ask:'ask'|'force') {
|
||||||
const db = get(DataBase)
|
const db = get(DataBase)
|
||||||
if(!(model.startsWith('gpt') || model === 'openrouter' || model === 'reverse_proxy' || model === 'textgen_webui')){
|
if(!(recommendedPresetExist(model))){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(ask === 'ask' && db.toggleConfirmRecommendedPreset){
|
if(ask === 'ask' && db.toggleConfirmRecommendedPreset){
|
||||||
@@ -28,28 +28,37 @@ export async function setRecommended(model: string, ask:'ask'|'force') {
|
|||||||
pr.mainPrompt = "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\nWrite {{char}}'s next reply in a fictional roleplay chat between {{user}} and {{char}}."
|
pr.mainPrompt = "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\nWrite {{char}}'s next reply in a fictional roleplay chat between {{user}} and {{char}}."
|
||||||
pr.ooba.formating.userPrefix = "### Instruction: "
|
pr.ooba.formating.userPrefix = "### Instruction: "
|
||||||
pr.ooba.formating.assistantPrefix = "### Response: "
|
pr.ooba.formating.assistantPrefix = "### Response: "
|
||||||
|
break
|
||||||
}
|
}
|
||||||
case 1:{ //Koala
|
case 1:{ //Koala
|
||||||
pr.mainPrompt = "BEGINNING OF CONVERSATION: Write {{char}}'s next reply in a fictional roleplay chat between {{user}} and {{char}}."
|
pr.mainPrompt = "BEGINNING OF CONVERSATION: Write {{char}}'s next reply in a fictional roleplay chat between {{user}} and {{char}}."
|
||||||
pr.ooba.formating.userPrefix = "USER: "
|
pr.ooba.formating.userPrefix = "USER: "
|
||||||
pr.ooba.formating.assistantPrefix = "GPT: "
|
pr.ooba.formating.assistantPrefix = "GPT: "
|
||||||
|
break
|
||||||
}
|
}
|
||||||
case 2:{ //Vicuna
|
case 2:{ //Vicuna
|
||||||
pr.mainPrompt = "BEGINNING OF CONVERSATION: A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n\nWrite {{char}}'s next reply in a fictional roleplay chat between {{user}} and {{char}}."
|
pr.mainPrompt = "BEGINNING OF CONVERSATION: A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n\nWrite {{char}}'s next reply in a fictional roleplay chat between {{user}} and {{char}}."
|
||||||
pr.ooba.formating.userPrefix = "USER: "
|
pr.ooba.formating.userPrefix = "USER: "
|
||||||
pr.ooba.formating.assistantPrefix = "ASSISTANT: "
|
pr.ooba.formating.assistantPrefix = "ASSISTANT: "
|
||||||
pr.ooba.formating.seperator = '</s>'
|
pr.ooba.formating.seperator = '</s>'
|
||||||
|
break
|
||||||
}
|
}
|
||||||
case 3:{ //WizardLM
|
case 3:{ //WizardLM
|
||||||
pr.mainPrompt = "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n\nWrite {{char}}'s next detailed reply in a fictional roleplay chat between {{user}} and {{char}}."
|
pr.mainPrompt = "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n\nWrite {{char}}'s next detailed reply in a fictional roleplay chat between {{user}} and {{char}}."
|
||||||
pr.ooba.formating.userPrefix = "USER: "
|
pr.ooba.formating.userPrefix = "USER: "
|
||||||
pr.ooba.formating.assistantPrefix = "ASSISTANT: "
|
pr.ooba.formating.assistantPrefix = "ASSISTANT: "
|
||||||
|
break
|
||||||
}
|
}
|
||||||
default:{
|
default:{
|
||||||
pr.mainPrompt = "Write {{char}}'s next reply in a fictional roleplay chat between {{user}} and {{char}}."
|
pr.mainPrompt = "Write {{char}}'s next reply in a fictional roleplay chat between {{user}} and {{char}}."
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setDatabase(setPreset(db, pr))
|
setDatabase(setPreset(db, pr))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function recommendedPresetExist(model:string){
|
||||||
|
return model.startsWith('gpt') || model === 'openrouter' || model === 'reverse_proxy' || model === 'textgen_webui'
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user