whisper-node
whisper-node copied to clipboard
whisper-node sets rootDir to node_modules package when importing it
I have made the same issue in the ts version one . But thought I might as well leave it here for future reference.
Basically same issue as listed in the issue linked above.
Without loading the file with import whisper from 'whisper-node':
[INFO] Root directory: /home/wolf/develop/nodejs/okuuai/node_modules/whisper-node/lib/whisper.cpp // using process.cwd()
[INFO] Root directory path: /home/wolf/develop/nodejs/okuuai/src // using path
Without loading it:
[INFO] Root directory: /home/wolf/develop/nodejs/okuuai
[INFO] Root directory path: /home/wolf/develop/nodejs/okuuai/src
It would be great to have some help on this, please.
Currently having this issue as well. As a short-term workaround I am changing the directory back to my expected root directory before setting anything else up.
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
process.chdir(__dirname);
dotenv.config();