Prd/resources/whisper
Lucy Doupalů be9f14ce34 Helpdesk - operator console + patched GrapheneOS Dialer for call handling
A small helpdesk system: an office Pixel running a patched GrapheneOS Dialer
answers technician calls, records both call legs as separate channels, and a
Ruby backend transcribes them through Whisper and files an AI summary against
the caller.

Squashed to a single commit for sharing. No credentials are included; secrets
live outside the repo in /etc/helpdesk/env on the server or a gitignored
.claude/env.local locally. See .claude/env.local.example for the shape.

Start at README.md, then docs/architecture.md.
2026-07-27 18:50:32 +02:00
..
README.md Helpdesk - operator console + patched GrapheneOS Dialer for call handling 2026-07-27 18:50:32 +02:00
requirements.txt Helpdesk - operator console + patched GrapheneOS Dialer for call handling 2026-07-27 18:50:32 +02:00
smoke_test.sh Helpdesk - operator console + patched GrapheneOS Dialer for call handling 2026-07-27 18:50:32 +02:00
transcribe.py Helpdesk - operator console + patched GrapheneOS Dialer for call handling 2026-07-27 18:50:32 +02:00
watch_progress.sh Helpdesk - operator console + patched GrapheneOS Dialer for call handling 2026-07-27 18:50:32 +02:00

transcribe.py - Czech audio → text with speaker tags

Offline Czech speech-to-text. Output is plain [Speaker N]: … turns. Built on WhisperX (Whisper large-v2 + Czech wav2vec2 alignment + pyannote speaker-diarization-community-1). 100% local - no cloud calls.

One-time setup (~5 min + ~5 GB model download on first run)

sudo apt install ffmpeg                  # Debian/Ubuntu; use your distro's pkg mgr otherwise
cd whisper
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

The Hugging Face token in .env is mine and the gated-repo terms are already accepted on that account, so it just works. No HF account or clicks needed on your side. If you'd rather use your own token, replace HF_TOKEN in .env, then visit (logged in) and click "Agree" on:

Run

set -a; source .env; set +a              # load HF_TOKEN
source .venv/bin/activate                # if not already active
python transcribe.py recording.m4a       # → recording.txt

Common flags:

--timestamps             prepend [HH:MM:SS] to each turn
--min-speakers 2         lower bound (default 2)
--max-speakers 3         upper bound (default 3)
--model large-v3         alternative model (default: large-v2)
--language en            non-Czech audio
-o out.txt               custom output path

Accepts any format ffmpeg can read: mp3, wav, m4a, ogg, flac, mp4, …

Speed

  • NVIDIA GPU: ~realtime (10 min audio → ~10 min processing)
  • CPU only: 5-20× slower (10 min audio → 1-3 hours). The tool warns and proceeds automatically.

Live progress bar (optional)

In a second terminal while a run is going:

bash watch_progress.sh

Smoke test (optional)

bash smoke_test.sh - needs espeak-ng (sudo apt install espeak-ng). Synthesizes a fake 2-speaker Czech dialogue and runs the full pipeline. TTS audio so the transcription is robotic gibberish; only verifies plumbing.

Exit codes

0 ok · 2 bad args / missing token · 3 no ffmpeg · 5 HF terms not accepted · 6 alignment model failed · 7 diarization failed · 130 Ctrl-C