[fix] ooba system

This commit is contained in:
kwaroran
2023-11-22 21:04:14 +09:00
parent 248a810b9f
commit 5293a19f8b

View File

@@ -188,6 +188,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
formatedChat = formated formatedChat = formated
} }
let oobaSystemPrompts:string[] = []
for(let i=0;i<formatedChat.length;i++){ for(let i=0;i<formatedChat.length;i++){
if(formatedChat[i].role !== 'function'){ if(formatedChat[i].role !== 'function'){
if(arg.isGroupChat && formatedChat[i].name){ if(arg.isGroupChat && formatedChat[i].name){
@@ -203,6 +204,20 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
delete formatedChat[i].memo delete formatedChat[i].memo
delete formatedChat[i].removable delete formatedChat[i].removable
} }
if(aiModel === 'reverse_proxy' && db.reverseProxyOobaMode && formatedChat[i].role === 'system'){
const cont = formatedChat[i].content
if(typeof(cont) === 'string'){
oobaSystemPrompts.push(cont)
formatedChat[i].content = ''
}
}
}
if(oobaSystemPrompts.length > 0){
formatedChat.push({
role: 'system',
content: oobaSystemPrompts.join('\n')
})
} }
@@ -223,6 +238,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
let oaiFunctions:OaiFunctions[] = [] let oaiFunctions:OaiFunctions[] = []
@@ -305,7 +321,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
body[key] = OobaBodyTemplate[key] body[key] = OobaBodyTemplate[key]
} }
} }
arg.useStreaming = false
} }
if(supportsInlayImage()){ if(supportsInlayImage()){