Skip to content

Commit 1ed3223

Browse files
committed
Support IndexDB for Larger model, modify artifact cache template
1 parent fbfa926 commit 1ed3223

File tree

3 files changed

+335
-44
lines changed

3 files changed

+335
-44
lines changed

web/src/artifact_cache.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,25 @@
2121
*/
2222
export interface ArtifactCacheTemplate {
2323
/**
24-
* fetch key url from cache
24+
* fetch key url from cache, optional storetype for IndexDB
25+
*
26+
* storagetype for indexDB have two options:
27+
* 1. json: return a json object
28+
* 2. arraybuffer: return an arraybuffer object
2529
*/
26-
fetchWithCache(url: string);
30+
fetchWithCache(url: string, storetype?: string);
2731

2832
/**
29-
* add ey url to cache
33+
* add key url to cache, optional storetype for IndexDB
34+
*
35+
* storagetype for indexDB have two options:
36+
* 1. json: return a json object
37+
* 2. arraybuffer: return an arraybuffer object
38+
*
39+
* returns the response or the specified stored object
40+
* for reduced database transaction
3041
*/
31-
addToCache(url: string);
32-
42+
addToCache(url: string, storetype?: string): Promise<any>;
3343
/**
3444
* check if cache has all keys in Cache
3545
*/

web/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export {
2222
PackedFunc, Module, NDArray,
2323
TVMArray, TVMObject, VirtualMachine,
2424
InitProgressCallback, InitProgressReport,
25-
ArtifactCache, Instance, instantiate, hasNDArrayInCache, deleteNDArrayCache
25+
ArtifactCache, ArtifactindexDBCache, Instance, instantiate, hasNDArrayInCache, deleteNDArrayCache
2626
} from "./runtime";
2727
export { Disposable, LibraryProvider } from "./types";
2828
export { RPCServer } from "./rpc_server";

0 commit comments

Comments
 (0)