[fix] ooba autosuggest
This commit is contained in:
@@ -77,14 +77,14 @@
|
||||
|
||||
if($DataBase.subModel === "textgen_webui"){
|
||||
promptbody = [
|
||||
...lastMessages.map(({ role, data }) => ({
|
||||
role: role === "user" ? "user" as const : "assistant" as const,
|
||||
content: data,
|
||||
})),
|
||||
{
|
||||
role: 'system',
|
||||
content: replacePlaceholders($DataBase.autoSuggestPrompt, currentChar.name)
|
||||
},
|
||||
...lastMessages.map(({ role, data }) => ({
|
||||
role: role === "user" ? "user" as const : "assistant" as const,
|
||||
content: data,
|
||||
})),
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -47,11 +47,11 @@ export function stringlizeChatOba(formated:OpenAIChat[], characterName:string=''
|
||||
let prefix = ""
|
||||
let name = ""
|
||||
if(form.role === 'user'){
|
||||
prefix = appendWhitespace(userPrefix, seperator)
|
||||
prefix = appendWhitespace(suggesting ? assistantPrefix : userPrefix, seperator)
|
||||
name = `${db.username}: `
|
||||
}
|
||||
else if(form.role === 'assistant'){
|
||||
prefix = appendWhitespace(assistantPrefix, seperator)
|
||||
prefix = appendWhitespace(suggesting ? userPrefix : assistantPrefix, seperator)
|
||||
name = `${characterName}: `
|
||||
}
|
||||
else if(form.role === 'system'){
|
||||
@@ -60,7 +60,7 @@ export function stringlizeChatOba(formated:OpenAIChat[], characterName:string=''
|
||||
resultString.push(prefix + name + form.content)
|
||||
}
|
||||
if (suggesting){
|
||||
resultString.push(appendWhitespace(assistantPrefix, seperator) + "\n" + db.autoSuggestPrefix)
|
||||
resultString.push(appendWhitespace(assistantPrefix, seperator) + `${db.username}:\n` + db.autoSuggestPrefix)
|
||||
} else {
|
||||
resultString.push(assistantPrefix + `${characterName}:`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user