Fix tfCache initialization and assignment

This commit is contained in:
kwaroran
2024-01-06 20:50:49 +09:00
parent 46ee706399
commit afd085bd93

View File

@@ -4,16 +4,16 @@ import { loadAsset, saveAsset } from 'src/ts/storage/globalApi';
import { selectSingleFile } from 'src/ts/util';
import { v4 } from 'uuid';
const tfCache = new Cache()
let tfCache:Cache = null
let tfLoaded = false
async function initTransformers(){
if(tfLoaded){
return
}
const tfCache = new Cache()
tfCache = await caches.open('transformers')
env.localModelPath = "/tf/"
env.remoteHost = "https://sv.risuai.xyz/transformers/"
env.customCache = await caches.open('transformers')
env.customCache = tfCache
tfLoaded = true
}