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