]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
examples : fix node compilation (#2115)
authorPedro Probst <redacted>
Thu, 2 May 2024 21:52:55 +0000 (18:52 -0300)
committerGitHub <redacted>
Thu, 2 May 2024 21:52:55 +0000 (22:52 +0100)
* node : fix compilation and update examples

* node : fix readme

* Update addon.node test

.github/workflows/examples.yml
examples/addon.node/CMakeLists.txt
examples/addon.node/README.md
examples/addon.node/__test__/whisper.spec.js
examples/addon.node/index.js
examples/addon.node/package.json

index ddaf5e9de5dddfddea41c7e6e2e887aa4eef87bb..808dd18c0b70705bd3bc749bb222ad0ca3307173 100644 (file)
@@ -37,7 +37,7 @@ jobs:
         run: npm install
 
       - 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
         run: |
index aef7839eb778da399388a01b08c057fe3ebac67c..29cb1a27d078942687b71bf66601b027b15edeb5 100644 (file)
@@ -1,4 +1,4 @@
-set(TARGET whisper-addon)
+set(TARGET addon.node)
 
 # Base settings
 #==================================================================
index bdb1d256beccd739a0e22b34d69383ff193207c8..16df7d95870cb13f7aa10a546b9584508bcc9cae 100644 (file)
@@ -14,14 +14,14 @@ npm install
 Make sure it is in the project root directory and compiled with make-js.
 
 ```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.
 
 > Such as appointing special cmake path:
 > ```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
index d102fe7624ee13435b4d31d253343f380f334ae9..c0367a8c5872478f224460d6aa8ed96074226fca 100644 (file)
@@ -1,7 +1,7 @@
 const path = require("path");
 const { whisper } = require(path.join(
   __dirname,
-  "../../../build/Release/whisper-addon"
+  "../../../build/Release/addon.node"
 ));
 const { promisify } = require("util");
 
@@ -12,6 +12,7 @@ const whisperParamsMock = {
   model: path.join(__dirname, "../../../models/ggml-base.en.bin"),
   fname_inp: path.join(__dirname, "../../../samples/jfk.wav"),
   use_gpu: true,
+  no_timestamps: false,
 };
 
 describe("Run whisper.node", () => {
index 3c6429375abe20a305c6122e5199e817f0d3d50e..9156a52de0744714fb85ef6e72ec6dcfb3a23397 100644 (file)
@@ -1,7 +1,7 @@
 const path = require("path");
 const { whisper } = require(path.join(
   __dirname,
-  "../../build/Release/whisper-addon"
+  "../../build/Release/addon.node"
 ));
 const { promisify } = require("util");
 
@@ -12,6 +12,7 @@ const whisperParams = {
   model: path.join(__dirname, "../../models/ggml-base.en.bin"),
   fname_inp: "../../samples/jfk.wav",
   use_gpu: true,
+  no_timestamps: false,
 };
 
 const arguments = process.argv.slice(2);
index bf51f0bba9f482694666ead68785d50bbccbeec9..50046bf1f56a6418a75732cff54c51d2decdf60d 100644 (file)
@@ -1,5 +1,5 @@
 {
-  "name": "whisper-addon",
+  "name": "addon.node",
   "version": "0.0.0",
   "description": "",
   "main": "index.js",