Spaces:
Running
Running
Download source/scripts/copy-wasm.mjs from Segizu/geometria3d-lab: direct link, hf CLI and curl.
- Browser
- Download file 800 Bytes
-
https://huggingface.co/spaces/Segizu/geometria3d-lab/resolve/main/source/scripts/copy-wasm.mjs
- Command line
-
hf download hf://spaces/Segizu/geometria3d-lab/source/scripts/copy-wasm.mjs
-
curl -L -o copy-wasm.mjs https://huggingface.co/spaces/Segizu/geometria3d-lab/resolve/main/source/scripts/copy-wasm.mjs
800 Bytes
| // Copia los binarios fijados de ONNX Runtime Web a public/wasm (el Space los sirve; sin CDN de terceros). | |
| import { mkdirSync, copyFileSync, readFileSync } from 'node:fs'; | |
| import path from 'node:path'; | |
| const ortDir = new URL('../node_modules/onnxruntime-web/', import.meta.url).pathname; | |
| const ver = JSON.parse(readFileSync(path.join(ortDir, 'package.json'), 'utf8')).version; | |
| const out = new URL('../public/wasm/', import.meta.url).pathname; | |
| mkdirSync(out, { recursive: true }); | |
| // `onnxruntime-web/webgpu` (build extern-wasm) usa la variante asyncify (WebGPU + WASM/CPU). | |
| for (const f of ['ort-wasm-simd-threaded.asyncify.mjs', 'ort-wasm-simd-threaded.asyncify.wasm']) copyFileSync(path.join(ortDir, 'dist', f), path.join(out, f)); | |
| console.log(`copied onnxruntime-web@${ver} wasm -> public/wasm`); | |