This is a simple matrix bot that transcribes your voice to text message using faster-whisper, a reimplementation of OpenAI's Whisper model using CTranslate2.
config.json
or .env
with proper valuescompose.yaml
Here is a guide to make bot works on E2E encrypted room.
For explainations and complete parameter list see: https://github.com/hibobmaster/matrix-stt-bot/wiki
config.json
Tips: set a non-exist room_id
at the first time to prevent bot handling historical message which may mess your room up.
{
"homeserver": "https://matrix.org",
"user_id": "@xxxx:matrix.org",
"password": "xxxxxxxxxx",
"device_id": "GMIAZSVFF",
"room_id": "!xxxxxxxx:xxx.xxx.xxx",
"model_size": "base",
"import_keys_path": "element-keys.txt",
"import_keys_password": "xxxxxxxxxxxx"
}
compose.yaml
services:
app:
image: ghcr.io/hibobmaster/matrix-stt-bot:latest
container_name: matrix-stt-bot
restart: always
# build:
# context: .
# dockerfile: ./Dockerfile
# env_file:
# - .env
volumes:
# use env file or config.json
- ./config.json:/app/config.json
# use touch to create an empty file stt_db, for persist database only
- ./stt_db:/app/db
# import_keys path
- ./element-keys.txt:/app/element-keys.txt
# store whisper models that program will download
- ./models:/app/models
networks:
- matrix_network
networks:
matrix_network:
Get your E2E room keys here: Notice: If you deploy matrix_chatgpt_bot along with this project, remember do not use the same database name.
docker compose up
You will get notice: INFO - start import_keys process
After INFO - import_keys success, please remove import_keys configuration!!!
Wait a second, to see if stt_db
has finished syncing_progress (The space occupied is about 100kb and above?)
Then Ctrl+C
stop the container
config.json
againRemove import_keys_path
and import_keys_password
options
Set a correct room_id
or remove it if you hope the bot to work in the rooms it is in.
Tips: if bot exits because RuntimeError: Unable to open file 'model.bin' in model
, try rm -r models
then relaunch the container.
Launch the container
docker compose up -d