Update version to 1.71.3 and add file URL mapping

This commit is contained in:
kwaroran
2024-01-06 22:31:42 +09:00
parent e974b5ee7f
commit de17fe3afa
4 changed files with 11 additions and 8 deletions

View File

@@ -8,7 +8,7 @@
},
"package": {
"productName": "RisuAI",
"version": "1.71.2"
"version": "1.71.3"
},
"tauri": {
"allowlist": {

View File

@@ -6,6 +6,7 @@ import { v4 } from 'uuid';
let tfCache:Cache = null
let tfLoaded = false
let tfMap:{[key:string]:string} = {}
async function initTransformers(){
if(tfLoaded){
return
@@ -26,6 +27,10 @@ async function initTransformers(){
const newURL = 'https://sv.risuai.xyz/transformers/' + url.substring(11)
await tfCache.add(newURL)
}
if(Object.keys(tfMap).includes(url)){
const assetId = tfMap[url]
return new Response(await loadAsset(assetId))
}
}
return await tfCache.match(url)
}
@@ -120,11 +125,9 @@ export const runVITS = async (text: string, modelData:string|OnnxModelFiles = 'X
const files = modelData.files
const keys = Object.keys(files)
for(const key of keys){
const ast = new Response(await loadAsset(files[key]))
tfCache.put(key,ast.clone())
tfCache.put(location.origin + key, ast.clone())
console.log('put', key)
console.log('put', location.origin + key)
const fileURL = '/tf/' + modelData.id + '/' + key
tfMap[fileURL] = files[key]
tfMap[location.origin + fileURL] = files[key]
}
lastSynth = modelData.id
synthesizer = await pipeline('text-to-speech', modelData.id);

View File

@@ -15,7 +15,7 @@ import type { OobaChatCompletionRequestParams } from '../model/ooba';
export const DataBase = writable({} as any as Database)
export const loadedStore = writable(false)
export let appVer = "1.71.2"
export let appVer = "1.71.3"
export let webAppSubVer = ''
export function setDatabase(data:Database){

View File

@@ -1 +1 @@
{"version":"1.71.2"}
{"version":"1.71.3"}