Picovoice / cheetah

On-device streaming speech-to-text engine powered by deep learning
https://picovoice.ai/
Apache License 2.0
582 stars 67 forks source link

Cheetah Issue: cheetah_params.pv picovoice File is `<!-- ` while library is '2.0' #335

Open AbsurdSyssie opened 3 weeks ago

AbsurdSyssie commented 3 weeks ago

Have you checked the docs and existing issues?

SDK

React

Cheetah package version

2.0.0

Framework version

react 18 Node.js v20.13.1.

Platform

Windows (x86_64)

OS/Browser version

Windows 11

Describe the bug

Attempting to use cheetah STT in react 18. Downloaded latest cheetah_params.pv, placed in /public/models folder. Used npm install for the relevant libraries. Set up cheetah init with my access key and the correct path to the cheetah params. On initiation get the error CheetahInvalidArgumentError: Initialization failed: [0] Cheetah model (.pv) file belongs to a different version of the library. File is <!-- while library is 2.0.0. [1] Picovoice Error (code 00000136)

Steps To Reproduce

npm install @picovoice/cheetah-react @picovoice/web-voice-processor Downlod cheetah_params.pv from the github repo Reference cheetah_params in the init function const initEngine = async () => { console.log("Initializing Cheetah with model_params.");

try {
  await init("access_key", {
    cheetahModel: "models/cheetah_params.pv",
  });
  console.log("Cheetah initialized successfully.");
} catch (error) {
  console.error("Error initializing Cheetah:", error.message);
}

};

Also tried with base 64 option.

Use voice widget, on initialisation get the above error.

Expected Behavior

On pressing initialise should load the params and carry out stt function.

AbsurdSyssie commented 3 weeks ago

Also attempted to use the demo from this page https://picovoice.ai/docs/quick-start/cheetah-react/ Get an error; npm run start

cheetah-react-demo@2.0.0 start node scripts/run_demo.js start

node:internal/child_process:421 throw new ErrnoException(err, 'spawn'); ^

Error: spawn EINVAL at ChildProcess.spawn (node:internal/child_process:421:11) at spawn (node:child_process:761:9) at Object.fork (node:child_process:172:10) at Object. (C:\Users\Oscar\Python_Projects\cheetah_test\cheetah\demo\react\scripts\run_demo.js:40:15)
at Module._compile (node:internal/modules/cjs/loader:1358:14) at Module._extensions..js (node:internal/modules/cjs/loader:1416:10) at Module.load (node:internal/modules/cjs/loader:1208:32) at Module._load (node:internal/modules/cjs/loader:1024:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12) at node:internal/main/run_main_module:28:49 { errno: -4071, code: 'EINVAL', syscall: 'spawn' }

Node.js v20.13.1 PS C:\Users\Oscar\Python_Projects\cheetah_test\cheetah\demo\react> npm run start

cheetah-react-demo@2.0.0 start node scripts/run_demo.js start

node:internal/child_process:421 throw new ErrnoException(err, 'spawn'); ^

Error: spawn EINVAL at ChildProcess.spawn (node:internal/child_process:421:11) at spawn (node:child_process:761:9) at Object.fork (node:child_process:172:10) at Object. (C:\Users\Oscar\Python_Projects\cheetah_test\cheetah\demo\react\scripts\run_demo.js:40:15)
at Module._compile (node:internal/modules/cjs/loader:1358:14) at Module._extensions..js (node:internal/modules/cjs/loader:1416:10) at Module.load (node:internal/modules/cjs/loader:1208:32) at Module._load (node:internal/modules/cjs/loader:1024:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12) at node:internal/main/run_main_module:28:49 { errno: -4071, code: 'EINVAL', syscall: 'spawn' }

Node.js v20.13.1

laves commented 3 weeks ago

@AbsurdSyssie - thanks for the report. The spawn EINVAL error you received with the React demo was a real issue with our launch script running on the latest Node 20 on Windows. We've addressed that with #336.

As for your initial issue - can you reproduce it using the demo (now that we've fixed the launch script)? We generally prefer addressing issues using our demos as shared code to rule out any issues with user code.