Skip to content

Commit

Permalink
Support IndexDB for Larger model, modify artifact cache template
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoCao committed Mar 23, 2024
1 parent fbfa926 commit 3edd8cf
Show file tree
Hide file tree
Showing 3 changed files with 286 additions and 34 deletions.
16 changes: 12 additions & 4 deletions web/src/artifact_cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,22 @@
*/
export interface ArtifactCacheTemplate {
/**
* fetch key url from cache
* fetch key url from cache, optional storetype for IndexDB
*
* storagetype for indexDB have two options:
* 1. json: return a json object
* 2. arraybuffer: return an arraybuffer object
*/
fetchWithCache(url: string);
fetchWithCache(url: string, storetype?: string);

/**
* add ey url to cache
* add key url to cache, optional storetype for IndexDB
*
* storagetype for indexDB have two options:
* 1. json: return a json object
* 2. arraybuffer: return an arraybuffer object
*/
addToCache(url: string);
addToCache(url: string, storetype?: string);

/**
* check if cache has all keys in Cache
Expand Down
2 changes: 1 addition & 1 deletion web/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export {
PackedFunc, Module, NDArray,
TVMArray, TVMObject, VirtualMachine,
InitProgressCallback, InitProgressReport,
ArtifactCache, Instance, instantiate, hasNDArrayInCache, deleteNDArrayCache
ArtifactCache, ArtifactIndexDBCache, Instance, instantiate, hasNDArrayInCache, deleteNDArrayCache
} from "./runtime";
export { Disposable, LibraryProvider } from "./types";
export { RPCServer } from "./rpc_server";
Expand Down
Loading

0 comments on commit 3edd8cf

Please sign in to comment.