Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] root directory getting set to whisperer's. #2

Open
YozoraWolf opened this issue May 11, 2024 · 0 comments
Open

[BUG] root directory getting set to whisperer's. #2

YozoraWolf opened this issue May 11, 2024 · 0 comments

Comments

@YozoraWolf
Copy link

🪲 Bug

I followed the instructions to install, by the time I ran it I realized that my .env file wasn't being found so I thought it was a bug from my codebase so I debugged a little, then I resorted to git reset HEAD --hard. So I discovered that once I imported whisperer the whole project root was getting set elsewhere, breaking my whole program. That's when I reinstalled the npm dependency and realized the following message appeared:

[whisper-node-ts] Problem. whisper.cpp not initialized. Current shelljs directory:  /home/wolf/develop/nodejs/okuuai/node_modules/whisper-node-ts/dist
[whisper-node-ts] Attempting to run 'make' command in /whisper directory...
[whisper-node-ts] 'make' command successful. Current shelljs directory:  /home/wolf/develop/nodejs/okuuai/node_modules/whisper-node-ts/dist

My program ran into the same issue but this time I noticed that shelljs dir is being set to the dist dir of whisperer package. So I double checked by doing a process.cwd() and path.resolve(__dirname) and realized the following:

📝 Aditional Info

[INFO] Root directory: /home/wolf/develop/nodejs/okuuai/node_modules/whisper-node-ts/lib/whisper.cpp // process.cwd()
[INFO] Root directory path: /home/wolf/develop/nodejs/okuuai/src // path.resolve(__dirname)

Now I could go ahead and just resolve all paths with the later, but I don't think that would be a proper solution.

Here's the code I used:

import { Logger } from '@src/logger';
import { whisper } from 'whisper-node-ts';

export const initVoice = async (): Promise<void> => {
    const transcript = await whisper("test/1.wav", {
        modelName: "small"
    });
    
    Logger.INFO(`Transcript: ${transcript}`); // output: [ {start,end,speech} ]

};

Could you provide any input or support on this, please? I'd like to use this for my project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant