Merge branch 'main' into main

This commit is contained in:
kwaroran
2024-02-07 02:26:28 +09:00
committed by GitHub
19 changed files with 605 additions and 86 deletions

View File

@@ -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)
@@ -586,6 +588,8 @@ export interface Database{
lastPatchNoteCheckVersion?:string,
removePunctuationHypa?:boolean
memoryLimitThickness?:number
modules: RisuModule[]
enabledModules: string[]
}
export interface customscript{
@@ -838,6 +842,7 @@ export interface Chat{
suggestMessages?:string[]
isStreaming?:boolean
scriptstate?:{[key:string]:string|number|boolean}
modules?:string[]
}
export interface Message{
@@ -1119,6 +1124,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()

View File

@@ -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