Skip to content

Simple bot that transcribes Telegram voice messages. Powered by go-telegram-bot-api & whisper.cpp Go bindings.

Notifications You must be signed in to change notification settings

chinese-soup/cbot-telegram-whisper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cbot-telegram-whisper

Quick and dirty bot (or more of a PoC) that transcribes Telegram voice messages using OpenAI's whisper models, using CPU inference thanks to whisper.cpp

Built using:

TODO

  • refactor
  • possibly get rid of ffmpeg lib?
  • fix error handling & generating

How to build

You can check out the example Dockerfile, but TL;DR:

git clone [email protected]:chinese-soup/cbot-telegram-whisper.git && \
cd cbot-telegram-whisper && \
git clone https://github.com/ggerganov/whisper.cpp.git && \
cd whisper.cpp/bindings/go && \
make whisper && \
cd ../../.. && \
go get
C_INCLUDE_PATH=/app/whisper.cpp/ LIBRARY_PATH=/app/whisper.cpp/ go build -o whisperbot

Get a model, e.g.:

bash whisper.cpp/models/download-ggml-model.sh tiny.en

Check out whisper.cpp's README for more info.

Set the environment variables mentioned in .env.example, e.g.:

export TELEGRAM_APITOKEN=<your bot token here>
export MODELPATH=whisper.cpp/models/ggml-tiny.en.bin

Make sure ffmpeg is in $PATH:

$ which ffmpeg
/usr/bin/ffmpeg

If it isn't install a binary or compile and put it in path.

And you're all set, run it:

./whisperbot

About

Simple bot that transcribes Telegram voice messages. Powered by go-telegram-bot-api & whisper.cpp Go bindings.

Topics

Resources

Stars

Watchers

Forks