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

Draft: Basic example server #1375

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

Conversation

Azeirah
Copy link

@Azeirah Azeirah commented Oct 18, 2023

A server example for whisper.cpp, based on the LLaMa.cpp server example.
This is still a work-in-progress, but the very basics work.

Why would you want to run whisper as a server? If you need to process a short clip often, for example on a voice-controlled application, the model you're using is loaded into RAM every time ./main is invoked. For very short voice snippets of about 3-5 seconds, about 50% of the time is spent loading the base-en model every time.

With this you can simply send a http request to this web-server and your wav file gets converted immediately.

Progress

  • Supports basic (model selection & performance & quality) parameters for whisper
  • Supports same server parameters as LLaMa.cpp server example
  • Supports /convert endpoint, send a .wav filename and get transcription + metadata back as JSON
  • Sends error messages in JSON when something goes wrong
  • Supports diarization
  • Supports language detection
  • Server is documented in README.md

Note that it's been a while since I used C++, I made most of this happen with frankenstein copy-pasting. If I'm doing something stupid please let me know.

@Azeirah Azeirah mentioned this pull request Oct 18, 2023
@bobqianic bobqianic linked an issue Oct 20, 2023 that may be closed by this pull request
@litongjava
Copy link
Contributor

When do you plan to merge this PR, I want to use this feature as soon as possible.

@Azeirah
Copy link
Author

Azeirah commented Nov 3, 2023

When do you plan to merge this PR, I want to use this feature as soon as possible.

Whenever ggerganov is done with his changes. I'll make sure a reasonably feature complete server example will be merged.

#1369 (comment)

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.

Server example?
2 participants