Spaces:
Running
Running
Upload holo-load2bit.mjs with huggingface_hub
Browse files- holo-load2bit.mjs +5 -4
holo-load2bit.mjs
CHANGED
|
@@ -110,10 +110,11 @@ export async function loadKappaObject(baseUrl, opts = {}) {
|
|
| 110 |
// hash the on-GPU verifier reproduces; else SHA-256 (SRI axis, default). Untrusted-CDN-safe either way.
|
| 111 |
let got;
|
| 112 |
if (man.hash === "blake3") {
|
| 113 |
-
//
|
| 114 |
-
//
|
| 115 |
-
|
| 116 |
-
|
|
|
|
| 117 |
catch (e) { got = "blake3:" + blake3hex(gz); }
|
| 118 |
} else got = "blake3:" + blake3hex(gz);
|
| 119 |
} else got = "sha256:" + hex(await crypto.subtle.digest("SHA-256", gz));
|
|
|
|
| 110 |
// hash the on-GPU verifier reproduces; else SHA-256 (SRI axis, default). Untrusted-CDN-safe either way.
|
| 111 |
let got;
|
| 112 |
if (man.hash === "blake3") {
|
| 113 |
+
// OPT-IN (?verify=gpu → globalThis.__gpuVerify): re-derive on the GPU. Default = CPU BLAKE3 (the proven,
|
| 114 |
+
// working path). GPU verify wired here fails during engine construction (2-device conflict — see note);
|
| 115 |
+
// needs a single-device refactor before it can be default. On any GPU error, fall back to CPU.
|
| 116 |
+
if (typeof globalThis !== "undefined" && globalThis.__gpuVerify && gpuBlake3Available()) {
|
| 117 |
+
try { const h = await gpuBlake3Hex(gz); got = "blake3:" + h; }
|
| 118 |
catch (e) { got = "blake3:" + blake3hex(gz); }
|
| 119 |
} else got = "blake3:" + blake3hex(gz);
|
| 120 |
} else got = "sha256:" + hex(await crypto.subtle.digest("SHA-256", gz));
|