mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-02-03 11:59:25 +01:00
examples : fix node compilation (#2115)
* node : fix compilation and update examples * node : fix readme * Update addon.node test
This commit is contained in:
parent
8fac6455ff
commit
58210d6a76
2
.github/workflows/examples.yml
vendored
2
.github/workflows/examples.yml
vendored
@ -37,7 +37,7 @@ jobs:
|
|||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
- name: Compile addon.node
|
- name: Compile addon.node
|
||||||
run: npx cmake-js compile -T whisper-addon -B Release
|
run: npx cmake-js compile -T addon.node -B Release
|
||||||
|
|
||||||
- name: Download test model
|
- name: Download test model
|
||||||
run: |
|
run: |
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
set(TARGET whisper-addon)
|
set(TARGET addon.node)
|
||||||
|
|
||||||
# Base settings
|
# Base settings
|
||||||
#==================================================================
|
#==================================================================
|
||||||
|
@ -14,14 +14,14 @@ npm install
|
|||||||
Make sure it is in the project root directory and compiled with make-js.
|
Make sure it is in the project root directory and compiled with make-js.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npx cmake-js compile -T whisper-addon -B Release
|
npx cmake-js compile -T addon.node -B Release
|
||||||
```
|
```
|
||||||
|
|
||||||
For Electron addon and cmake-js options, you can see [cmake-js](https://github.com/cmake-js/cmake-js) and make very few configuration changes.
|
For Electron addon and cmake-js options, you can see [cmake-js](https://github.com/cmake-js/cmake-js) and make very few configuration changes.
|
||||||
|
|
||||||
> Such as appointing special cmake path:
|
> Such as appointing special cmake path:
|
||||||
> ```shell
|
> ```shell
|
||||||
> npx cmake-js compile -c 'xxx/cmake' -T whisper-addon -B Release
|
> npx cmake-js compile -c 'xxx/cmake' -T addon.node -B Release
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
## Run
|
## Run
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
const path = require("path");
|
const path = require("path");
|
||||||
const { whisper } = require(path.join(
|
const { whisper } = require(path.join(
|
||||||
__dirname,
|
__dirname,
|
||||||
"../../../build/Release/whisper-addon"
|
"../../../build/Release/addon.node"
|
||||||
));
|
));
|
||||||
const { promisify } = require("util");
|
const { promisify } = require("util");
|
||||||
|
|
||||||
@ -12,6 +12,7 @@ const whisperParamsMock = {
|
|||||||
model: path.join(__dirname, "../../../models/ggml-base.en.bin"),
|
model: path.join(__dirname, "../../../models/ggml-base.en.bin"),
|
||||||
fname_inp: path.join(__dirname, "../../../samples/jfk.wav"),
|
fname_inp: path.join(__dirname, "../../../samples/jfk.wav"),
|
||||||
use_gpu: true,
|
use_gpu: true,
|
||||||
|
no_timestamps: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
describe("Run whisper.node", () => {
|
describe("Run whisper.node", () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
const path = require("path");
|
const path = require("path");
|
||||||
const { whisper } = require(path.join(
|
const { whisper } = require(path.join(
|
||||||
__dirname,
|
__dirname,
|
||||||
"../../build/Release/whisper-addon"
|
"../../build/Release/addon.node"
|
||||||
));
|
));
|
||||||
const { promisify } = require("util");
|
const { promisify } = require("util");
|
||||||
|
|
||||||
@ -12,6 +12,7 @@ const whisperParams = {
|
|||||||
model: path.join(__dirname, "../../models/ggml-base.en.bin"),
|
model: path.join(__dirname, "../../models/ggml-base.en.bin"),
|
||||||
fname_inp: "../../samples/jfk.wav",
|
fname_inp: "../../samples/jfk.wav",
|
||||||
use_gpu: true,
|
use_gpu: true,
|
||||||
|
no_timestamps: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
const arguments = process.argv.slice(2);
|
const arguments = process.argv.slice(2);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "whisper-addon",
|
"name": "addon.node",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
Loading…
Reference in New Issue
Block a user