[fix] continue

This commit is contained in:
kwaroran
2023-09-09 07:48:34 +09:00
parent 78b963625c
commit a9564189c4
4 changed files with 11 additions and 10 deletions

View File

@@ -391,12 +391,14 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
let chats:OpenAIChat[] = examples let chats:OpenAIChat[] = examples
console.log(db.aiModel)
chats.push({ if(!db.aiModel.startsWith('novelai')){
role: 'system', chats.push({
content: '[Start a new chat]', role: 'system',
memo: "NewChat" content: '[Start a new chat]',
}) memo: "NewChat"
})
}
if(nowChatroom.type !== 'group'){ if(nowChatroom.type !== 'group'){
const firstMsg = nowChatroom.firstMsgIndex === -1 ? nowChatroom.firstMessage : nowChatroom.alternateGreetings[nowChatroom.firstMsgIndex] const firstMsg = nowChatroom.firstMsgIndex === -1 ? nowChatroom.firstMessage : nowChatroom.alternateGreetings[nowChatroom.firstMsgIndex]
@@ -702,7 +704,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
currentChar: currentChar, currentChar: currentChar,
useStreaming: true, useStreaming: true,
isGroupChat: nowChatroom.type === 'group', isGroupChat: nowChatroom.type === 'group',
bias: {} bias: {},
}, 'model', abortSignal) }, 'model', abortSignal)
let result = '' let result = ''

View File

@@ -46,8 +46,6 @@ export function stringlizeNAIChat(formated:OpenAIChat[], char:string, continued:
} }
} }
console.log(resultString)
let res = resultString.join(seperator) let res = resultString.join(seperator)
if(!continued){ if(!continued){

View File

@@ -360,6 +360,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
} }
case 'novelai': case 'novelai':
case 'novelai_kayra':{ case 'novelai_kayra':{
console.log(arg.continue)
const proompt = stringlizeNAIChat(formated, currentChar?.name ?? '', arg.continue) const proompt = stringlizeNAIChat(formated, currentChar?.name ?? '', arg.continue)
let logit_bias_exp:{ let logit_bias_exp:{
sequence: number[], bias: number, ensure_sequence_finish: false, generate_once: true sequence: number[], bias: number, ensure_sequence_finish: false, generate_once: true

View File

@@ -22,7 +22,7 @@ export async function setRecommended(model: string, ask:'ask'|'force') {
setDatabase(setPreset(db, pr)) setDatabase(setPreset(db, pr))
} }
else if(db.aiModel.startsWith('novelai')){ else if(db.aiModel.startsWith('novelai')){
const pr:botPreset = prebuiltPresets.NAI const pr:botPreset = prebuiltPresets.NAI2
setDatabase(setPreset(db, pr)) setDatabase(setPreset(db, pr))
} }
else if(db.aiModel === 'textgen_webui' || db.aiModel === 'mancer'){ else if(db.aiModel === 'textgen_webui' || db.aiModel === 'mancer'){