[feat] new nai formating/kayra
This commit is contained in:
@@ -295,6 +295,38 @@
|
|||||||
<TextInput marginBottom bind:value={$DataBase.ooba.formating.seperator} />
|
<TextInput marginBottom bind:value={$DataBase.ooba.formating.seperator} />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
{:else if $DataBase.aiModel.startsWith('novelai')}
|
||||||
|
<span class="text-neutral-200">Top P</span>
|
||||||
|
<SliderInput min={0} max={1} step={0.01} bind:value={$DataBase.NAIsettings.topP}/>
|
||||||
|
<span class="text-gray-400 mb-6 text-sm">{($DataBase.NAIsettings.topP).toFixed(2)}</span>
|
||||||
|
<span class="text-neutral-200">Top P</span>
|
||||||
|
<SliderInput min={0} max={100} step={1} bind:value={$DataBase.NAIsettings.topK}/>
|
||||||
|
<span class="text-gray-400 mb-6 text-sm">{($DataBase.NAIsettings.topK).toFixed(0)}</span>
|
||||||
|
<span class="text-neutral-200">Top A</span>
|
||||||
|
<SliderInput min={0} max={1} step={0.01} bind:value={$DataBase.NAIsettings.topA}/>
|
||||||
|
<span class="text-gray-400 mb-6 text-sm">{($DataBase.NAIsettings.topA).toFixed(2)}</span>
|
||||||
|
<span class="text-neutral-200">Tailfree Sampling</span>
|
||||||
|
<SliderInput min={0} max={1} step={0.001} bind:value={$DataBase.NAIsettings.tailFreeSampling}/>
|
||||||
|
<span class="text-gray-400 mb-6 text-sm">{($DataBase.NAIsettings.tailFreeSampling).toFixed(3)}</span>
|
||||||
|
<span class="text-neutral-200">Typical P</span>
|
||||||
|
<SliderInput min={0} max={1} step={0.01} bind:value={$DataBase.NAIsettings.typicalp}/>
|
||||||
|
<span class="text-gray-400 mb-6 text-sm">{($DataBase.NAIsettings.tailFreeSampling).toFixed(2)}</span>
|
||||||
|
<span class="text-neutral-200">Repetition Penalty</span>
|
||||||
|
<SliderInput min={0} max={3} step={0.01} bind:value={$DataBase.NAIsettings.repetitionPenalty}/>
|
||||||
|
<span class="text-gray-400 mb-6 text-sm">{($DataBase.NAIsettings.repetitionPenalty).toFixed(2)}</span>
|
||||||
|
<span class="text-neutral-200">Repetition Penalty Range</span>
|
||||||
|
<SliderInput min={0} max={2048} step={1} bind:value={$DataBase.NAIsettings.repetitionPenaltyRange}/>
|
||||||
|
<span class="text-gray-400 mb-6 text-sm">{($DataBase.NAIsettings.repetitionPenaltyRange).toFixed(0)}</span>
|
||||||
|
<span class="text-neutral-200">Repetition Penalty Slope</span>
|
||||||
|
<SliderInput min={0} max={10} step={0.01} bind:value={$DataBase.NAIsettings.repetitionPenaltySlope}/>
|
||||||
|
<span class="text-gray-400 mb-6 text-sm">{($DataBase.NAIsettings.repetitionPenaltySlope).toFixed(2)}</span>
|
||||||
|
<span class="text-neutral-200">Frequency Penalty</span>
|
||||||
|
<SliderInput min={-2} max={2} step={0.01} bind:value={$DataBase.NAIsettings.frequencyPenalty}/>
|
||||||
|
<span class="text-gray-400 mb-6 text-sm">{($DataBase.NAIsettings.frequencyPenalty).toFixed(2)}</span>
|
||||||
|
<span class="text-neutral-200">Presence Penalty</span>
|
||||||
|
<SliderInput min={-2} max={2} step={0.01} bind:value={$DataBase.NAIsettings.presencePenalty}/>
|
||||||
|
<span class="text-gray-400 mb-6 text-sm">{($DataBase.NAIsettings.presencePenalty).toFixed(2)}</span>
|
||||||
|
|
||||||
{:else if $DataBase.aiModel.startsWith('novellist')}
|
{:else if $DataBase.aiModel.startsWith('novellist')}
|
||||||
<span class="text-neutral-200">Top P</span>
|
<span class="text-neutral-200">Top P</span>
|
||||||
<SliderInput min={0} max={2} step={0.01} bind:value={$DataBase.ainconfig.top_p}/>
|
<SliderInput min={0} max={2} step={0.01} bind:value={$DataBase.ainconfig.top_p}/>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
case "novelai":
|
case "novelai":
|
||||||
return "NovelAI"
|
return "NovelAI"
|
||||||
case "novelai_kayra":
|
case "novelai_kayra":
|
||||||
return "NovelAI_kayra"
|
return "NovelAI Kayra"
|
||||||
case "novellist":
|
case "novellist":
|
||||||
return "NovelList SuperTrin"
|
return "NovelList SuperTrin"
|
||||||
case "novellist damsel":
|
case "novellist damsel":
|
||||||
|
|||||||
363
src/ts/process/models/nai.ts
Normal file
363
src/ts/process/models/nai.ts
Normal file
@@ -0,0 +1,363 @@
|
|||||||
|
import { DataBase } from "src/ts/storage/database"
|
||||||
|
import type { OpenAIChat } from ".."
|
||||||
|
import { get } from "svelte/store"
|
||||||
|
|
||||||
|
export function stringlizeNAIChat(formated:OpenAIChat[], char:string = ''){
|
||||||
|
const db = get(DataBase)
|
||||||
|
let resultString:string[] = []
|
||||||
|
for(const form of formated){
|
||||||
|
if(form.role === 'system'){
|
||||||
|
if(form.memo === 'NewChatExample' || form.memo === 'NewChat'){
|
||||||
|
resultString.push('[conversation: start]\n***')
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
resultString.push(form.content)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(form.name || form.role === 'assistant'){
|
||||||
|
resultString.push((form.name ?? char) + ": " + form.content)
|
||||||
|
}
|
||||||
|
else if(form.role === 'user'){
|
||||||
|
resultString.push(db.username + ": " + form.content)
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
resultString.push(form.content)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return resultString.join('\n\n') + `\n\n${char}:`
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface NAISettings{
|
||||||
|
topK: number
|
||||||
|
topP: number
|
||||||
|
topA: number
|
||||||
|
tailFreeSampling: number
|
||||||
|
repetitionPenalty: number
|
||||||
|
repetitionPenaltyRange: number
|
||||||
|
repetitionPenaltySlope: number
|
||||||
|
repostitionPenaltyPresence: number
|
||||||
|
seperator: string
|
||||||
|
frequencyPenalty: number
|
||||||
|
presencePenalty: number
|
||||||
|
typicalp:number
|
||||||
|
}
|
||||||
|
|
||||||
|
export const NovelAIBadWordIds = [
|
||||||
|
[60],
|
||||||
|
[62],
|
||||||
|
[544],
|
||||||
|
[683],
|
||||||
|
[696],
|
||||||
|
[880],
|
||||||
|
[905],
|
||||||
|
[1008],
|
||||||
|
[1019],
|
||||||
|
[1084],
|
||||||
|
[1092],
|
||||||
|
[1181],
|
||||||
|
[1184],
|
||||||
|
[1254],
|
||||||
|
[1447],
|
||||||
|
[1570],
|
||||||
|
[1656],
|
||||||
|
[2194],
|
||||||
|
[2470],
|
||||||
|
[2479],
|
||||||
|
[2498],
|
||||||
|
[2947],
|
||||||
|
[3138],
|
||||||
|
[3291],
|
||||||
|
[3455],
|
||||||
|
[3725],
|
||||||
|
[3851],
|
||||||
|
[3891],
|
||||||
|
[3921],
|
||||||
|
[3951],
|
||||||
|
[4207],
|
||||||
|
[4299],
|
||||||
|
[4622],
|
||||||
|
[4681],
|
||||||
|
[5013],
|
||||||
|
[5032],
|
||||||
|
[5180],
|
||||||
|
[5218],
|
||||||
|
[5290],
|
||||||
|
[5413],
|
||||||
|
[5456],
|
||||||
|
[5709],
|
||||||
|
[5749],
|
||||||
|
[5774],
|
||||||
|
[6038],
|
||||||
|
[6257],
|
||||||
|
[6334],
|
||||||
|
[6660],
|
||||||
|
[6904],
|
||||||
|
[7082],
|
||||||
|
[7086],
|
||||||
|
[7254],
|
||||||
|
[7444],
|
||||||
|
[7748],
|
||||||
|
[8001],
|
||||||
|
[8088],
|
||||||
|
[8168],
|
||||||
|
[8562],
|
||||||
|
[8605],
|
||||||
|
[8795],
|
||||||
|
[8850],
|
||||||
|
[9014],
|
||||||
|
[9102],
|
||||||
|
[9259],
|
||||||
|
[9318],
|
||||||
|
[9336],
|
||||||
|
[9502],
|
||||||
|
[9686],
|
||||||
|
[9793],
|
||||||
|
[9855],
|
||||||
|
[9899],
|
||||||
|
[9955],
|
||||||
|
[10148],
|
||||||
|
[10174],
|
||||||
|
[10943],
|
||||||
|
[11326],
|
||||||
|
[11337],
|
||||||
|
[11661],
|
||||||
|
[12004],
|
||||||
|
[12084],
|
||||||
|
[12159],
|
||||||
|
[12520],
|
||||||
|
[12977],
|
||||||
|
[13380],
|
||||||
|
[13488],
|
||||||
|
[13663],
|
||||||
|
[13811],
|
||||||
|
[13976],
|
||||||
|
[14412],
|
||||||
|
[14598],
|
||||||
|
[14767],
|
||||||
|
[15640],
|
||||||
|
[15707],
|
||||||
|
[15775],
|
||||||
|
[15830],
|
||||||
|
[16079],
|
||||||
|
[16354],
|
||||||
|
[16369],
|
||||||
|
[16445],
|
||||||
|
[16595],
|
||||||
|
[16614],
|
||||||
|
[16731],
|
||||||
|
[16943],
|
||||||
|
[17278],
|
||||||
|
[17281],
|
||||||
|
[17548],
|
||||||
|
[17555],
|
||||||
|
[17981],
|
||||||
|
[18022],
|
||||||
|
[18095],
|
||||||
|
[18297],
|
||||||
|
[18413],
|
||||||
|
[18736],
|
||||||
|
[18772],
|
||||||
|
[18990],
|
||||||
|
[19181],
|
||||||
|
[20095],
|
||||||
|
[20197],
|
||||||
|
[20481],
|
||||||
|
[20629],
|
||||||
|
[20871],
|
||||||
|
[20879],
|
||||||
|
[20924],
|
||||||
|
[20977],
|
||||||
|
[21375],
|
||||||
|
[21382],
|
||||||
|
[21391],
|
||||||
|
[21687],
|
||||||
|
[21810],
|
||||||
|
[21828],
|
||||||
|
[21938],
|
||||||
|
[22367],
|
||||||
|
[22372],
|
||||||
|
[22734],
|
||||||
|
[23405],
|
||||||
|
[23505],
|
||||||
|
[23734],
|
||||||
|
[23741],
|
||||||
|
[23781],
|
||||||
|
[24237],
|
||||||
|
[24254],
|
||||||
|
[24345],
|
||||||
|
[24430],
|
||||||
|
[25416],
|
||||||
|
[25896],
|
||||||
|
[26119],
|
||||||
|
[26635],
|
||||||
|
[26842],
|
||||||
|
[26991],
|
||||||
|
[26997],
|
||||||
|
[27075],
|
||||||
|
[27114],
|
||||||
|
[27468],
|
||||||
|
[27501],
|
||||||
|
[27618],
|
||||||
|
[27655],
|
||||||
|
[27720],
|
||||||
|
[27829],
|
||||||
|
[28052],
|
||||||
|
[28118],
|
||||||
|
[28231],
|
||||||
|
[28532],
|
||||||
|
[28571],
|
||||||
|
[28591],
|
||||||
|
[28653],
|
||||||
|
[29013],
|
||||||
|
[29547],
|
||||||
|
[29650],
|
||||||
|
[29925],
|
||||||
|
[30522],
|
||||||
|
[30537],
|
||||||
|
[30996],
|
||||||
|
[31011],
|
||||||
|
[31053],
|
||||||
|
[31096],
|
||||||
|
[31148],
|
||||||
|
[31258],
|
||||||
|
[31350],
|
||||||
|
[31379],
|
||||||
|
[31422],
|
||||||
|
[31789],
|
||||||
|
[31830],
|
||||||
|
[32214],
|
||||||
|
[32666],
|
||||||
|
[32871],
|
||||||
|
[33094],
|
||||||
|
[33376],
|
||||||
|
[33440],
|
||||||
|
[33805],
|
||||||
|
[34368],
|
||||||
|
[34398],
|
||||||
|
[34417],
|
||||||
|
[34418],
|
||||||
|
[34419],
|
||||||
|
[34476],
|
||||||
|
[34494],
|
||||||
|
[34607],
|
||||||
|
[34758],
|
||||||
|
[34761],
|
||||||
|
[34904],
|
||||||
|
[34993],
|
||||||
|
[35117],
|
||||||
|
[35138],
|
||||||
|
[35237],
|
||||||
|
[35487],
|
||||||
|
[35830],
|
||||||
|
[35869],
|
||||||
|
[36033],
|
||||||
|
[36134],
|
||||||
|
[36320],
|
||||||
|
[36399],
|
||||||
|
[36487],
|
||||||
|
[36586],
|
||||||
|
[36676],
|
||||||
|
[36692],
|
||||||
|
[36786],
|
||||||
|
[37077],
|
||||||
|
[37594],
|
||||||
|
[37596],
|
||||||
|
[37786],
|
||||||
|
[37982],
|
||||||
|
[38475],
|
||||||
|
[38791],
|
||||||
|
[39083],
|
||||||
|
[39258],
|
||||||
|
[39487],
|
||||||
|
[39822],
|
||||||
|
[40116],
|
||||||
|
[40125],
|
||||||
|
[41000],
|
||||||
|
[41018],
|
||||||
|
[41256],
|
||||||
|
[41305],
|
||||||
|
[41361],
|
||||||
|
[41447],
|
||||||
|
[41449],
|
||||||
|
[41512],
|
||||||
|
[41604],
|
||||||
|
[42041],
|
||||||
|
[42274],
|
||||||
|
[42368],
|
||||||
|
[42696],
|
||||||
|
[42767],
|
||||||
|
[42804],
|
||||||
|
[42854],
|
||||||
|
[42944],
|
||||||
|
[42989],
|
||||||
|
[43134],
|
||||||
|
[43144],
|
||||||
|
[43189],
|
||||||
|
[43521],
|
||||||
|
[43782],
|
||||||
|
[44082],
|
||||||
|
[44162],
|
||||||
|
[44270],
|
||||||
|
[44308],
|
||||||
|
[44479],
|
||||||
|
[44524],
|
||||||
|
[44965],
|
||||||
|
[45114],
|
||||||
|
[45301],
|
||||||
|
[45382],
|
||||||
|
[45443],
|
||||||
|
[45472],
|
||||||
|
[45488],
|
||||||
|
[45507],
|
||||||
|
[45564],
|
||||||
|
[45662],
|
||||||
|
[46265],
|
||||||
|
[46267],
|
||||||
|
[46275],
|
||||||
|
[46295],
|
||||||
|
[46462],
|
||||||
|
[46468],
|
||||||
|
[46576],
|
||||||
|
[46694],
|
||||||
|
[47093],
|
||||||
|
[47384],
|
||||||
|
[47389],
|
||||||
|
[47446],
|
||||||
|
[47552],
|
||||||
|
[47686],
|
||||||
|
[47744],
|
||||||
|
[47916],
|
||||||
|
[48064],
|
||||||
|
[48167],
|
||||||
|
[48392],
|
||||||
|
[48471],
|
||||||
|
[48664],
|
||||||
|
[48701],
|
||||||
|
[49021],
|
||||||
|
[49193],
|
||||||
|
[49236],
|
||||||
|
[49550],
|
||||||
|
[49694],
|
||||||
|
[49806],
|
||||||
|
[49824],
|
||||||
|
[50001],
|
||||||
|
[50256],
|
||||||
|
[0],
|
||||||
|
[1],
|
||||||
|
[3],
|
||||||
|
[49356],
|
||||||
|
[1431],
|
||||||
|
[31715],
|
||||||
|
[34387],
|
||||||
|
[20765],
|
||||||
|
[30702],
|
||||||
|
[10691],
|
||||||
|
[49333],
|
||||||
|
[1266],
|
||||||
|
[19438],
|
||||||
|
[43145],
|
||||||
|
[26523],
|
||||||
|
[41471],
|
||||||
|
[2936]
|
||||||
|
]
|
||||||
@@ -8,6 +8,7 @@ import { globalFetch, isNodeServer, isTauri } from "../storage/globalApi";
|
|||||||
import { sleep } from "../util";
|
import { sleep } from "../util";
|
||||||
import { createDeep } from "./deepai";
|
import { createDeep } from "./deepai";
|
||||||
import { hubURL } from "../characterCards";
|
import { hubURL } from "../characterCards";
|
||||||
|
import { NovelAIBadWordIds, stringlizeNAIChat } from "./models/nai";
|
||||||
|
|
||||||
interface requestDataArgument{
|
interface requestDataArgument{
|
||||||
formated: OpenAIChat[]
|
formated: OpenAIChat[]
|
||||||
@@ -317,28 +318,41 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
|||||||
}
|
}
|
||||||
case 'novelai':
|
case 'novelai':
|
||||||
case 'novelai_kayra':{
|
case 'novelai_kayra':{
|
||||||
const proompt = stringlizeChat(formated, currentChar?.name ?? '')
|
const proompt = stringlizeNAIChat(formated, currentChar?.name ?? '')
|
||||||
const params = {
|
|
||||||
|
const gen = db.NAIsettings
|
||||||
|
const payload = {
|
||||||
|
temperature:temperature,
|
||||||
|
max_length: maxTokens,
|
||||||
|
min_length: 1,
|
||||||
|
top_k: gen.topK,
|
||||||
|
top_p: gen.topP,
|
||||||
|
top_a: gen.topA,
|
||||||
|
tail_free_sampling: gen.tailFreeSampling,
|
||||||
|
repetition_penalty: gen.repetitionPenalty,
|
||||||
|
repetition_penalty_range: gen.repetitionPenaltyRange,
|
||||||
|
repetition_penalty_slope: gen.repetitionPenaltySlope,
|
||||||
|
repetition_penalty_frequency: gen.frequencyPenalty,
|
||||||
|
repetition_penalty_presence: gen.presencePenalty,
|
||||||
|
generate_until_sentence: true,
|
||||||
|
use_cache: false,
|
||||||
|
use_string: true,
|
||||||
|
return_full_text: false,
|
||||||
|
prefix: 'vanilla',
|
||||||
|
order: [3,0],
|
||||||
|
bad_words_ids: NovelAIBadWordIds,
|
||||||
|
typical_p: gen.typicalp,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const body = {
|
||||||
"input": proompt,
|
"input": proompt,
|
||||||
"model":db.novelai.model,
|
"model":db.novelai.model,
|
||||||
"parameters":{
|
"parameters":payload
|
||||||
"use_string":true,
|
|
||||||
"temperature":1.7,
|
|
||||||
"max_length":90,
|
|
||||||
"min_length":1,
|
|
||||||
"tail_free_sampling":0.6602,
|
|
||||||
"repetition_penalty":1.0565,
|
|
||||||
"repetition_penalty_range":340,
|
|
||||||
"repetition_penalty_frequency":0,
|
|
||||||
"repetition_penalty_presence":0,
|
|
||||||
"use_cache":false,
|
|
||||||
"return_full_text":false,
|
|
||||||
"prefix":"vanilla",
|
|
||||||
"order":[3,0]}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const da = await globalFetch("https://api.novelai.net/ai/generate", {
|
const da = await globalFetch("https://api.novelai.net/ai/generate", {
|
||||||
body: params,
|
body: body,
|
||||||
headers: {
|
headers: {
|
||||||
"Authorization": "Bearer " + db.novelai.token
|
"Authorization": "Bearer " + db.novelai.token
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { DataBase, setPreset, type botPreset, setDatabase } from "src/ts/storage/database";
|
import { DataBase, setPreset, type botPreset, setDatabase } from "src/ts/storage/database";
|
||||||
import { get } from "svelte/store";
|
import { get } from "svelte/store";
|
||||||
import { prebuiltPresets } from "./templates";
|
import { prebuiltNAIpresets, prebuiltPresets } from "./templates";
|
||||||
import { alertConfirm, alertSelect } from "src/ts/alert";
|
import { alertConfirm, alertSelect } from "src/ts/alert";
|
||||||
import { language } from "src/lang";
|
import { language } from "src/lang";
|
||||||
|
|
||||||
@@ -20,6 +20,17 @@ export async function setRecommended(model: string, ask:'ask'|'force') {
|
|||||||
const pr:botPreset = prebuiltPresets.OAI
|
const pr:botPreset = prebuiltPresets.OAI
|
||||||
setDatabase(setPreset(db, pr))
|
setDatabase(setPreset(db, pr))
|
||||||
}
|
}
|
||||||
|
else if(db.aiModel.startsWith('novelai')){
|
||||||
|
const pr:botPreset = prebuiltPresets.OAI
|
||||||
|
pr.NAISettings = prebuiltNAIpresets
|
||||||
|
pr.temperature = 1.05
|
||||||
|
pr.maxContext = 8000
|
||||||
|
pr.maxResponse = 300
|
||||||
|
pr.mainPrompt = "***\n[ Style: chat ]"
|
||||||
|
pr.jailbreak = ''
|
||||||
|
pr.globalNote = ''
|
||||||
|
setDatabase(setPreset(db, pr))
|
||||||
|
}
|
||||||
else if(db.aiModel === 'textgen_webui'){
|
else if(db.aiModel === 'textgen_webui'){
|
||||||
const sel = parseInt(await alertSelect(["Llama, Alpaca", "Koala", "Vicuna", "WizardLM", "Others"]))
|
const sel = parseInt(await alertSelect(["Llama, Alpaca", "Koala", "Vicuna", "WizardLM", "Others"]))
|
||||||
let pr = prebuiltPresets.ooba
|
let pr = prebuiltPresets.ooba
|
||||||
@@ -60,5 +71,5 @@ export async function setRecommended(model: string, ask:'ask'|'force') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function recommendedPresetExist(model:string){
|
export function recommendedPresetExist(model:string){
|
||||||
return model.startsWith('gpt') || model === 'openrouter' || model === 'reverse_proxy' || model === 'textgen_webui'
|
return model.startsWith('gpt') || model === 'openrouter' || model === 'reverse_proxy' || model === 'textgen_webui' || model.startsWith('novelai')
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import type { botPreset } from "../../storage/database";
|
import type { botPreset } from "../../storage/database";
|
||||||
|
import type { NAISettings } from "../models/nai";
|
||||||
|
|
||||||
|
|
||||||
export const prebuiltPresets:{OAI:botPreset,ooba:botPreset} = {
|
export const prebuiltPresets:{OAI:botPreset,ooba:botPreset} = {
|
||||||
@@ -138,3 +139,19 @@ export const prebuiltPresets:{OAI:botPreset,ooba:botPreset} = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export const prebuiltNAIpresets:NAISettings = {
|
||||||
|
topK: 12,
|
||||||
|
topP: 0.85,
|
||||||
|
topA: 0.1,
|
||||||
|
tailFreeSampling: 0.915,
|
||||||
|
repetitionPenalty: 2.8,
|
||||||
|
repetitionPenaltyRange: 2048,
|
||||||
|
repetitionPenaltySlope: 0.02,
|
||||||
|
repostitionPenaltyPresence: 0,
|
||||||
|
seperator: "",
|
||||||
|
frequencyPenalty: 0.03,
|
||||||
|
presencePenalty: 0,
|
||||||
|
typicalp: 1
|
||||||
|
}
|
||||||
@@ -7,6 +7,8 @@ import { downloadFile, saveAsset as saveImageGlobal } from './globalApi';
|
|||||||
import { clone, cloneDeep } from 'lodash';
|
import { clone, cloneDeep } from 'lodash';
|
||||||
import { defaultAutoSuggestPrompt, defaultJailbreak, defaultMainPrompt } from './defaultPrompts';
|
import { defaultAutoSuggestPrompt, defaultJailbreak, defaultMainPrompt } from './defaultPrompts';
|
||||||
import { alertNormal } from '../alert';
|
import { alertNormal } from '../alert';
|
||||||
|
import type { NAISettings } from '../process/models/nai';
|
||||||
|
import { prebuiltNAIpresets } from '../process/templates/templates';
|
||||||
|
|
||||||
export const DataBase = writable({} as any as Database)
|
export const DataBase = writable({} as any as Database)
|
||||||
export const loadedStore = writable(false)
|
export const loadedStore = writable(false)
|
||||||
@@ -283,6 +285,7 @@ export function setDatabase(data:Database){
|
|||||||
data.openrouterRequestModel ??= 'openai/gpt-3.5-turbo'
|
data.openrouterRequestModel ??= 'openai/gpt-3.5-turbo'
|
||||||
data.toggleConfirmRecommendedPreset ??= true
|
data.toggleConfirmRecommendedPreset ??= true
|
||||||
data.officialplugins ??= {}
|
data.officialplugins ??= {}
|
||||||
|
data.NAIsettings ??= cloneDeep(prebuiltNAIpresets)
|
||||||
data.assetWidth ??= -1
|
data.assetWidth ??= -1
|
||||||
data.animationSpeed ??= 0.4
|
data.animationSpeed ??= 0.4
|
||||||
|
|
||||||
@@ -442,6 +445,7 @@ export interface botPreset{
|
|||||||
ooba: OobaSettings
|
ooba: OobaSettings
|
||||||
ainconfig: AINsettings
|
ainconfig: AINsettings
|
||||||
koboldURL?: string
|
koboldURL?: string
|
||||||
|
NAISettings?: NAISettings
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Database{
|
export interface Database{
|
||||||
@@ -586,6 +590,7 @@ export interface Database{
|
|||||||
assetWidth:number
|
assetWidth:number
|
||||||
animationSpeed:number
|
animationSpeed:number
|
||||||
botSettingAtStart:false
|
botSettingAtStart:false
|
||||||
|
NAIsettings:NAISettings
|
||||||
}
|
}
|
||||||
|
|
||||||
interface hordeConfig{
|
interface hordeConfig{
|
||||||
@@ -828,7 +833,8 @@ export function saveCurrentPreset(){
|
|||||||
ooba: cloneDeep(db.ooba),
|
ooba: cloneDeep(db.ooba),
|
||||||
ainconfig: cloneDeep(db.ainconfig),
|
ainconfig: cloneDeep(db.ainconfig),
|
||||||
proxyRequestModel: db.proxyRequestModel,
|
proxyRequestModel: db.proxyRequestModel,
|
||||||
openrouterRequestModel: db.openrouterRequestModel
|
openrouterRequestModel: db.openrouterRequestModel,
|
||||||
|
NAISettings: cloneDeep(db.NAIsettings)
|
||||||
}
|
}
|
||||||
db.botPresets = pres
|
db.botPresets = pres
|
||||||
setDatabase(db)
|
setDatabase(db)
|
||||||
@@ -882,6 +888,7 @@ export function setPreset(db:Database, newPres: botPreset){
|
|||||||
db.ainconfig = cloneDeep(newPres.ainconfig ?? db.ainconfig)
|
db.ainconfig = cloneDeep(newPres.ainconfig ?? db.ainconfig)
|
||||||
db.openrouterRequestModel = newPres.openrouterRequestModel ?? db.openrouterRequestModel
|
db.openrouterRequestModel = newPres.openrouterRequestModel ?? db.openrouterRequestModel
|
||||||
db.proxyRequestModel = newPres.proxyRequestModel ?? db.proxyRequestModel
|
db.proxyRequestModel = newPres.proxyRequestModel ?? db.proxyRequestModel
|
||||||
|
db.NAIsettings = newPres.NAISettings ?? db.NAIsettings
|
||||||
return db
|
return db
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user