[feat] new model selection screen
This commit is contained in:
@@ -241,7 +241,7 @@ export async function sendChat(chatProcessIndex = -1):Promise<boolean> {
|
||||
else{
|
||||
while(currentTokens > maxContextTokens){
|
||||
if(chats.length <= 1){
|
||||
alertError(language.errors.toomuchtoken)
|
||||
alertError(language.errors.toomuchtoken + "\n\nRequired Tokens: " + currentTokens)
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -418,6 +418,34 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
||||
}
|
||||
}
|
||||
}
|
||||
case "kobold":{
|
||||
const proompt = stringlizeChat(formated, currentChar?.name ?? '')
|
||||
const url = new URL(db.koboldURL)
|
||||
url.pathname = '/generate'
|
||||
|
||||
const da = await fetch(url, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
"prompt": proompt,
|
||||
"temperature": db.temperature,
|
||||
"top_p": 0.9
|
||||
}),
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
}
|
||||
})
|
||||
|
||||
if(da.status !== 200){
|
||||
return {
|
||||
type: "fail",
|
||||
result: await da.text(),
|
||||
noRetry: da.status >= 500
|
||||
}
|
||||
}
|
||||
|
||||
const data = await da.json()
|
||||
return data.results[0].text
|
||||
}
|
||||
default:{
|
||||
if(aiModel.startsWith("horde:::")){
|
||||
const proompt = stringlizeChat(formated, currentChar?.name ?? '')
|
||||
@@ -432,8 +460,8 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
||||
"frmtrmblln": false,
|
||||
"frmtrmspch": false,
|
||||
"frmttriminc": false,
|
||||
"max_context_length": 200,
|
||||
"max_length": 20,
|
||||
"max_context_length": db.maxContext + 100,
|
||||
"max_length": db.maxResponse,
|
||||
"rep_pen": 3,
|
||||
"rep_pen_range": 0,
|
||||
"rep_pen_slope": 10,
|
||||
|
||||
@@ -8,7 +8,7 @@ export function stringlizeChat(formated:OpenAIChat[], char:string = ''){
|
||||
let resultString:string[] = []
|
||||
for(const form of formated){
|
||||
if(form.role === 'system'){
|
||||
resultString.push("system note: " + form.content)
|
||||
resultString.push("system: " + form.content)
|
||||
}
|
||||
else if(form.name){
|
||||
resultString.push(form.name + ": " + form.content)
|
||||
@@ -23,7 +23,7 @@ export function stringlizeChat(formated:OpenAIChat[], char:string = ''){
|
||||
export function unstringlizeChat(text:string, formated:OpenAIChat[], char:string = ''){
|
||||
console.log(text)
|
||||
let minIndex = -1
|
||||
let chunks:string[] = ["system note:"]
|
||||
let chunks:string[] = ["system note:", "system:"]
|
||||
if(char){
|
||||
chunks.push(`${char}:`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user