Spaces:
Running
Running
Download source/scripts/hw.mjs from Segizu/rotoscopia-lab: direct link, hf CLI and curl.
- Browser
- Download file 642 Bytes
-
https://huggingface.co/spaces/Segizu/rotoscopia-lab/resolve/main/source/scripts/hw.mjs
- Command line
-
hf download hf://spaces/Segizu/rotoscopia-lab/source/scripts/hw.mjs
-
curl -L -o hw.mjs https://huggingface.co/spaces/Segizu/rotoscopia-lab/resolve/main/source/scripts/hw.mjs
642 Bytes
| import os from 'node:os'; | |
| import { readFileSync } from 'node:fs'; | |
| export function hardware() { | |
| let model = os.cpus()[0]?.model; | |
| let flags = ''; | |
| try { const c = readFileSync('/proc/cpuinfo', 'utf8'); flags = (c.match(/^flags\s*:\s*(.*)$/m) || [])[1] || ''; } catch {} | |
| const has = (f) => flags.split(' ').includes(f); | |
| return { cpu: model, logicalCores: os.cpus().length, ramGB: +(os.totalmem() / 1e9).toFixed(1), platform: `${os.platform()} ${os.release()}`, node: process.version, | |
| simd: { avx2: has('avx2'), avx512f: has('avx512f'), avx512_vnni: has('avx512_vnni'), avx512_fp16: has('avx512_fp16') }, gpu: 'none (CPU only)' }; | |
| } | |