From 901bf58c5cf9151942f8c4cd4e1427a02dec4b52 Mon Sep 17 00:00:00 2001 From: Tom Cooks Date: Sat, 10 Oct 2026 15:42:04 -0400 Subject: RECCoon 1.0.0: rebrand to Tom Cooks, Parakeet-only, GPLv3, F-Droid-ready --- tools/whistle-eval/build-data.mjs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tools/whistle-eval/build-data.mjs (limited to 'tools/whistle-eval/build-data.mjs') diff --git a/tools/whistle-eval/build-data.mjs b/tools/whistle-eval/build-data.mjs new file mode 100644 index 0000000..20be062 --- /dev/null +++ b/tools/whistle-eval/build-data.mjs @@ -0,0 +1,19 @@ +// Rebuilds the fp32 ONNX external-data files from the compact whistle.pack. +// This is the "small weights" path: instead of committing ~145 MB of .onnx.data +// to git (or downloading it), keep the 17 MB pack and expand it on first run. +import fs from 'fs'; +import { parsePack, buildModelData } from './vendor/js/pack.js'; + +const root = new URL('./vendor/', import.meta.url); +const packBytes = fs.readFileSync(new URL('whistle.pack', root)); +const pack = parsePack( + packBytes.buffer.slice(packBytes.byteOffset, packBytes.byteOffset + packBytes.byteLength)); + +for (const name of ['encoder', 'decoder']) { + const target = new URL(`onnx/${name}.onnx.data`, root); + const data = buildModelData(pack, name, (p) => { + process.stdout.write(`\r${name}: ${(p * 100).toFixed(0)}% `); + }); + fs.writeFileSync(target, data); + process.stdout.write(`\r${name}: wrote ${data.length} bytes\n`); +} -- cgit v1.2.3