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

Function storeFileInIDB

mediapipe-llm/script.js:42–60  ·  view source on GitHub ↗
(blob)

Source from the content-addressed store, hash-verified

40});
41
42const storeFileInIDB = async (blob) => {
43 try {
44 performance.mark('start-idb-cache');
45 await set('model.bin', blob);
46 performance.mark('end-idb-cache');
47 const mark = performance.measure(
48 'idb-cache',
49 'start-idb-cache',
50 'end-idb-cache'
51 );
52 console.log(
53 'Model file cached in IDB.',
54 mark.name,
55 mark.duration.toFixed(2)
56 );
57 } catch (err) {
58 console.error(err.name, err.message);
59 }
60};
61
62const storeFileInOPFS = async (blob) => {
63 try {

Callers 1

script.jsFile · 0.85

Calls 3

setFunction · 0.50
logMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected