[feat] novellist api

This commit is contained in:
kwaroran
2023-06-07 08:57:42 +09:00
parent f771fe3890
commit f37ae13d83
9 changed files with 464 additions and 20 deletions

View File

@@ -1,7 +1,13 @@
import type { Tiktoken } from "@dqbd/tiktoken";
import type { character } from "./storage/database";
import { DataBase, type character } from "./storage/database";
import { get } from "svelte/store";
import { tokenizeTransformers } from "./transformers/transformer";
async function encode(data:string):Promise<(number[]|Uint32Array)>{
let db = get(DataBase)
if(db.aiModel === 'novellist'){
return await tokenizeTransformers('trin',data)
}
return await tikJS(data)
}