Rename the app from "AU Whisper Web" to "Whisper Web" in the README title and app header, rename the package to whisper_web, and drop the au_ prefix from the transformers patch comment and the scratch path in isolate_wer2.ts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
16 lines
1.1 KiB
TypeScript
16 lines
1.1 KiB
TypeScript
// TEMP (delete after use): which component's q4 hurts — encoder or decoder?
|
|
import { pipeline } from "@huggingface/transformers";
|
|
const audio = new Float32Array(await Bun.file(process.argv[2]!).arrayBuffer());
|
|
const S = "/tmp/claude-1000/-home-user-whisper-web/b192bada-c438-4a43-a29d-c2969ef71f6c/scratchpad";
|
|
async function run(label: string, dtype: any) {
|
|
const asr = await pipeline("automatic-speech-recognition", "onnx-community/whisper-large-v3-turbo", { dtype, progress_callback: () => {} });
|
|
const t0 = performance.now();
|
|
const out = await asr(audio, { chunk_length_s: 30, stride_length_s: 5, return_timestamps: true, max_new_tokens: 440, language: "en", task: "transcribe" });
|
|
const single = (Array.isArray(out) ? out[0] : out) as { text?: string };
|
|
console.log(`${label}: ${((performance.now() - t0) / 1000).toFixed(0)}s`);
|
|
await Bun.write(`${S}/out-${label}.txt`, (single.text ?? "").trim());
|
|
await asr.dispose();
|
|
}
|
|
await run("encq8-decq4", { encoder_model: "q8", decoder_model_merged: "q4" });
|
|
await run("encq4-decq8", { encoder_model: "q4", decoder_model_merged: "q8" });
|