MCPcopy Create free account
hub / github.com/GoogleChrome/samples / storeFileHandleInIDB

Function storeFileHandleInIDB

mediapipe-llm/script.js:106–124  ·  view source on GitHub ↗
(handle)

Source from the content-addressed store, hash-verified

104};
105
106const storeFileHandleInIDB = async (handle) => {
107 try {
108 performance.mark('start-file-handle-cache');
109 await set('model.bin.handle', handle);
110 performance.mark('end-file-handle-cache');
111 const mark = performance.measure(
112 'file-handle-cache',
113 'start-file-handle-cache',
114 'end-file-handle-cache'
115 );
116 console.log(
117 'Model file handle cached in IDB.',
118 mark.name,
119 mark.duration.toFixed(2)
120 );
121 } catch (err) {
122 console.error(err.name, err.message);
123 }
124};
125
126const restoreFileFromIDB = async () => {
127 try {

Callers 1

script.jsFile · 0.85

Calls 3

setFunction · 0.50
logMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected