Fix tfCache initialization and assignment
This commit is contained in:
@@ -4,16 +4,16 @@ import { loadAsset, saveAsset } from 'src/ts/storage/globalApi';
|
|||||||
import { selectSingleFile } from 'src/ts/util';
|
import { selectSingleFile } from 'src/ts/util';
|
||||||
import { v4 } from 'uuid';
|
import { v4 } from 'uuid';
|
||||||
|
|
||||||
const tfCache = new Cache()
|
let tfCache:Cache = null
|
||||||
let tfLoaded = false
|
let tfLoaded = false
|
||||||
async function initTransformers(){
|
async function initTransformers(){
|
||||||
if(tfLoaded){
|
if(tfLoaded){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const tfCache = new Cache()
|
tfCache = await caches.open('transformers')
|
||||||
env.localModelPath = "/tf/"
|
env.localModelPath = "/tf/"
|
||||||
env.remoteHost = "https://sv.risuai.xyz/transformers/"
|
env.remoteHost = "https://sv.risuai.xyz/transformers/"
|
||||||
env.customCache = await caches.open('transformers')
|
env.customCache = tfCache
|
||||||
tfLoaded = true
|
tfLoaded = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user