Add Modules
This commit is contained in:
@@ -366,6 +366,8 @@ export function setDatabase(data:Database){
|
||||
data.openrouterMiddleOut ??= false
|
||||
data.removePunctuationHypa ??= true
|
||||
data.memoryLimitThickness ??= 1
|
||||
data.modules ??= []
|
||||
data.enabledModules ??= []
|
||||
|
||||
changeLanguage(data.language)
|
||||
DataBase.set(data)
|
||||
@@ -585,6 +587,8 @@ export interface Database{
|
||||
lastPatchNoteCheckVersion?:string,
|
||||
removePunctuationHypa?:boolean
|
||||
memoryLimitThickness?:number
|
||||
modules: RisuModule[]
|
||||
enabledModules: string[]
|
||||
}
|
||||
|
||||
export interface customscript{
|
||||
@@ -837,6 +841,7 @@ export interface Chat{
|
||||
suggestMessages?:string[]
|
||||
isStreaming?:boolean
|
||||
scriptstate?:{[key:string]:string|number|boolean}
|
||||
modules?:string[]
|
||||
}
|
||||
|
||||
export interface Message{
|
||||
@@ -1118,6 +1123,7 @@ export function setPreset(db:Database, newPres: botPreset){
|
||||
import { encode as encodeMsgpack, decode as decodeMsgpack } from "msgpackr";
|
||||
import * as fflate from "fflate";
|
||||
import type { OnnxModelFiles } from '../process/embedding/transformers';
|
||||
import type { RisuModule } from '../process/modules';
|
||||
|
||||
export async function downloadPreset(id:number){
|
||||
saveCurrentPreset()
|
||||
|
||||
@@ -44,7 +44,11 @@ interface fetchLog{
|
||||
|
||||
let fetchLog:fetchLog[] = []
|
||||
|
||||
export async function downloadFile(name:string, data:Uint8Array|ArrayBuffer) {
|
||||
export async function downloadFile(name:string, dat:Uint8Array|ArrayBuffer|string) {
|
||||
if(typeof(dat) === 'string'){
|
||||
dat = Buffer.from(dat, 'utf-8')
|
||||
}
|
||||
const data = new Uint8Array(dat)
|
||||
const downloadURL = (data:string, fileName:string) => {
|
||||
const a = document.createElement('a')
|
||||
a.href = data
|
||||
|
||||
Reference in New Issue
Block a user