This commit is contained in:
josc146
2023-05-20 14:53:52 +08:00
parent 0f0281dd63
commit 361d7a5619
8 changed files with 25 additions and 14 deletions

View File

@@ -56,8 +56,9 @@ export async function refreshBuiltInModels(readCache: boolean = false) {
return cache;
}
export async function refreshLocalModels(cache: Cache) {
cache.models = cache.models.filter(m => !m.isLocal);
export async function refreshLocalModels(cache: Cache, filter: boolean = true) {
if (filter)
cache.models = cache.models.filter(m => !m.isLocal); //TODO BUG cause local but in manifest files to be removed, so currently cache is disabled
await ListDirFiles(manifest.localModelDir).then((data) => {
cache.models.push(...data.flatMap(d => {