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

add wip wyoming cli #2853

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

pepijndevos
Copy link

Should fix #2738 once it's tested, polished, and approved

I basically applied https://gist.github.com/jaharon/b18536bd28455ab961ce5e13712f30d9 and deleted all the code for reading and writing various types of files.

So what this does is basically read a wyoming json+wav chunk, and spit out text

Next my plan is to update https://github.com/rhasspy/wyoming-whisper-cpp to build whisper.cpp as a submodule and then test it on my raspberry pi.

@pepijndevos
Copy link
Author

I have confirmed this works in rhasspy/wyoming-whisper-cpp#4

If there is no interest in having it upstream, another option would be to build it as a standalone binary downstream, but I wasn't able to figure out how to reuse the whisper.cpp cmake infrastructure to build an out of tree example with all the right includes and libraries.

@ggerganov
Copy link
Owner

It seems that the new example that you propose is very similar to the existing cli example. Maybe it would be simpler to add the changes directly in the cli example?

@pepijndevos
Copy link
Author

I tried that initially, but the way each chunk of json+wav on stdin is essentially processed as a separate file seemed a bit at odds with how the cli example works. So it seemed simpler to split off the example than to complicate the cli option parsing and main loop.

@ggerganov
Copy link
Owner

I see. I think you can introduce a CLI flag -wyoming that if provided, then the input loop will switch from files to json+wav.

I would like to avoid having a new example that is so similar to an existing one - it will be more difficult to maintain. Let me know if the above propose would work.

@pepijndevos
Copy link
Author

pepijndevos commented Mar 8, 2025

Sure I can give it a go.

Another alternative is to just maintain this as part of the python package but I'd have to figure out the build system. I think that might honestly make more sense since it's somewhat coupled.

@ggerganov
Copy link
Owner

Yes, it would make more sense. Note that the example apart from using libwhisper, also uses functionality from common which you would need to re-implement downstream. It's mostly utility stuff such as argument parsing, grammar (which probably you don't need), etc. Let me know if you encounter any problems.

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

Successfully merging this pull request may close these issues.

Wyoming / stdio server
2 participants