Streaming transcriber with whisper
Find a file
2022-09-27 12:24:49 +09:00
.github Improved CI setting 2022-09-27 12:24:49 +09:00
whispering Fix CI 2022-09-27 12:22:58 +09:00
.gitignore Initial commit 2022-09-23 19:20:29 +09:00
.markdownlint.json Initial commit 2022-09-23 19:20:29 +09:00
LICENSE Initial commit 2022-09-23 19:20:29 +09:00
LICENSE.whisper Initial commit 2022-09-23 19:20:29 +09:00
Makefile Renamed whisper_streaming to whispering 2022-09-26 00:32:54 +09:00
package-lock.json Initial commit 2022-09-23 19:20:29 +09:00
package.json Initial commit 2022-09-23 19:20:29 +09:00
poetry.lock Updated libraries 2022-09-25 18:17:55 +09:00
pyproject.toml Fix CI 2022-09-26 00:42:02 +09:00
README.md Updated README 2022-09-26 00:50:41 +09:00
setup.cfg Fix setting for isort 2022-09-23 20:05:33 +09:00

Whispering

MIT License Python Versions

CI CodeQL Typos

Streaming transcriber with whisper. Enough machine power is needed to transcribe in real time.

Setup

pip install -U git+https://github.com/shirayu/whispering.git

# If you use GPU, install proper torch and torchaudio
# Example : torch for CUDA 11.6
pip install -U torch torchaudio --extra-index-url https://download.pytorch.org/whl/cu116

Example of microphone

# Run in English
whispering --language en --model tiny
  • --help shows full options
  • --model set the model name to use. Larger models will be more accurate, but may not be able to transcribe in real time.
  • --language sets the language to transcribe. The list of languages are shown with whispering -h
  • -t sets temperatures to decode. You can set several like (-t 0.0 -t 0.1 -t 0.5), but too many temperatures exhaust decoding time
  • --debug outputs logs for debug

Parse interval

If you want quick response, set small -n and add --allow-padding. However, this may sacrifice the accuracy.

whispering --language en --model tiny -n 20 --allow-padding

Example of web socket

No security mechanism. Please make secure with your responsibility.

Run with --host and --port.

Host

whispering --language en --model tiny --host 0.0.0.0 --port 8000

You can set --allow-padding and other options.

Client

whispering --model tiny --host ADDRESS_OF_HOST --port 8000 --mode client

You can set -n and other options.

Tips

PortAudio Error

If you get OSError: PortAudio library not found: Install portaudio

# Ubuntu
sudo apt-get install portaudio19-dev

License