Spaces:
Running
Running
Download examples/addon.node/__test__/whisper.spec.js from natasa365/whisper.cpp: direct link, hf CLI and curl.
- Browser
- Download file 770 Bytes
-
https://huggingface.co/spaces/natasa365/whisper.cpp/resolve/afce5f4976def569d27e1fc597749df4554d5206/examples/addon.node/__test__/whisper.spec.js
- Command line
-
hf download hf://spaces/natasa365/whisper.cpp@afce5f4976def569d27e1fc597749df4554d5206/examples/addon.node/__test__/whisper.spec.js
-
curl -L -o whisper.spec.js https://huggingface.co/spaces/natasa365/whisper.cpp/resolve/afce5f4976def569d27e1fc597749df4554d5206/examples/addon.node/__test__/whisper.spec.js
770 Bytes
| const path = require("path"); | |
| const { whisper } = require(path.join( | |
| __dirname, | |
| "../../../build/Release/addon.node" | |
| )); | |
| const { promisify } = require("util"); | |
| const whisperAsync = promisify(whisper); | |
| const whisperParamsMock = { | |
| language: "en", | |
| model: path.join(__dirname, "../../../models/ggml-base.en.bin"), | |
| fname_inp: path.join(__dirname, "../../../samples/jfk.wav"), | |
| use_gpu: true, | |
| flash_attn: false, | |
| no_prints: true, | |
| comma_in_time: false, | |
| translate: true, | |
| no_timestamps: false, | |
| audio_ctx: 0, | |
| max_len: 0, | |
| }; | |
| describe("Run whisper.node", () => { | |
| test("it should receive a non-empty value", async () => { | |
| let result = await whisperAsync(whisperParamsMock); | |
| expect(result.length).toBeGreaterThan(0); | |
| }, 10000); | |
| }); | |