Spaces:
Running
Running
Download bnz4fetch.js from EncryptidSystems/EdgeAI: direct link, hf CLI and curl.
- Browser
- Download file 659 Bytes
-
https://huggingface.co/spaces/EncryptidSystems/EdgeAI/resolve/main/bnz4fetch.js
- Command line
-
hf download hf://spaces/EncryptidSystems/EdgeAI/bnz4fetch.js
-
curl -L -o bnz4fetch.js https://huggingface.co/spaces/EncryptidSystems/EdgeAI/resolve/main/bnz4fetch.js
659 Bytes
| // Fills the weight heap with a BNZ4 model's decoded bytes (bnz4load.js), on this worker's own GPU | |
| // device. The guest reads the heap while later segments are still arriving. | |
| import { fillHeap4 } from "./bnz4load.js"; | |
| self.onmessage = async (e) => { | |
| const m = e.data || {}; | |
| try { | |
| await fillHeap4({ url: m.url, prefix: m.prefix, step: m.step, window: m.window || null }, { buffer: m.buf }, m.table, new Int32Array(m.flags), (p) => { | |
| self.postMessage({ type: "progress", p }); | |
| }); | |
| self.postMessage({ type: "done" }); | |
| } catch (err) { | |
| self.postMessage({ type: "error", text: err && err.message ? err.message : String(err) }); | |
| } | |
| }; | |