ac94227b94
- SQLite: tasks with subtasks and time tracking, subscriptions + payments, routines + history, reminder log. All rules in core.Ops (tested: ops/tests). - brain: free text → JSON actions via the local claude CLI (Haiku, the subscription); only whitelisted operations are applied, nothing is deleted. - Telegram bot (owner only): text and voice (faster-whisper on the VM), /today /tasks /subs /routines /stop, morning digest and daily reminders with Done/Paid/Tomorrow. - HTTP API for BroV (bearer token): agenda, tasks, subs, routines, say, action. - deploy/install.sh: user brovops, venv, systemd; a proxy-only mihomo (127.0.0.1:7890, checksum-verified) so Telegram and Claude work from Russia without a VPN on the VM. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
665 B
Python
17 lines
665 B
Python
"""Telegram voice notes → text with faster-whisper, locally on the VM (no audio leaves it).
|
|
The model loads on first use and stays in memory."""
|
|
import threading
|
|
|
|
_model = None
|
|
_lock = threading.Lock()
|
|
|
|
|
|
def transcribe(path: str, model_name: str = "small") -> str:
|
|
global _model
|
|
with _lock:
|
|
if _model is None:
|
|
from faster_whisper import WhisperModel # heavy import: only when a voice note comes
|
|
_model = WhisperModel(model_name, device="cpu", compute_type="int8")
|
|
segments, _ = _model.transcribe(path, language="ru", vad_filter=True, beam_size=1)
|
|
return " ".join(s.text.strip() for s in segments).strip()
|