[feat] improve ooba template & ooba config

This commit is contained in:
kwaroran
2023-08-30 20:04:21 +09:00
parent 4ef79c9e3c
commit 1b39526474
8 changed files with 231 additions and 20 deletions

View File

@@ -11,6 +11,7 @@ import { hubURL } from "../characterCards";
import { NovelAIBadWordIds, stringlizeNAIChat } from "./models/nai";
import { tokenizeNum } from "../tokenizer";
import { runLocalModel } from "./models/local";
import { risuChatParser } from "../parser";
interface requestDataArgument{
formated: OpenAIChat[]
@@ -454,9 +455,12 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
let bodyTemplate:any
const suggesting = model === "submodel"
const proompt = stringlizeChatOba(formated, currentChar.name, suggesting, arg.continue)
const stopStrings = getStopStrings(suggesting)
console.log(proompt)
console.log(stopStrings)
let stopStrings = getStopStrings(suggesting)
if(db.localStopStrings){
stopStrings = db.localStopStrings.map((v) => {
return risuChatParser(v.replace(/\\n/g, "\n"))
})
}
bodyTemplate = {
'max_new_tokens': db.maxResponse,
'do_sample': true,