51 lines
2.2 KiB
Python
51 lines
2.2 KiB
Python
import os
|
|
from pathlib import Path
|
|
|
|
APP_ID = "com.cht.StreamAgent"
|
|
APP_NAME = "CHT"
|
|
|
|
# Default session data location — in project dir for easy clearing
|
|
PROJECT_DIR = Path(__file__).resolve().parent.parent
|
|
DATA_DIR = PROJECT_DIR / "data"
|
|
SESSIONS_DIR = Path(os.environ.get("CHT_SESSIONS_DIR", DATA_DIR / "sessions"))
|
|
|
|
# Stream defaults
|
|
STREAM_HOST = "0.0.0.0"
|
|
STREAM_PORT = 4444
|
|
RELAY_PORT = 4445 # UDP loopback relay for live display
|
|
|
|
# Frame extraction — scene-only, no interval fallback
|
|
SCENE_THRESHOLD = 0.10 # 0-1, lower = more sensitive; 0.1 catches slide/window changes
|
|
SCENE_FLUSH_FRAMES = 2 # extra frames after scene change to flush encoder/muxer buffer (0 to disable)
|
|
|
|
# Segment recording
|
|
SEGMENT_DURATION = 60 # seconds per .ts segment
|
|
|
|
# Audio extraction
|
|
AUDIO_EXTRACT_INTERVAL = 3 # seconds between extraction cycles
|
|
AUDIO_SAFETY_MARGIN = 2 # seconds safety margin (matches scene detector)
|
|
WAVEFORM_BUCKET_MS = 50 # milliseconds per waveform peak bucket
|
|
|
|
# Transcription
|
|
WHISPER_MODEL = "medium" # "small" for speed, "medium" for accuracy
|
|
WHISPER_DEVICE = "cuda" # "cuda" or "cpu"
|
|
TRANSCRIBE_MIN_CHUNK_S = 5 # minimum seconds of audio before transcribing
|
|
TRANSCRIBE_LINES_PER_GROUP = 3 # whisper segments grouped per transcript ID (1-5)
|
|
|
|
# Agent settings
|
|
AGENT_PERMISSION_MODE = "bypassPermissions" # default|acceptEdits|plan|bypassPermissions|dontAsk
|
|
AGENT_MAX_TURNS = 5
|
|
|
|
# Offline summarization (post-session diarization + export)
|
|
# whisperx lives in its own venv to avoid dep clashes with cht's faster_whisper.
|
|
# Defaults mirror transcribe_oneoff.sh: large-v3 + int8 fits in ~3-4 GB VRAM and
|
|
# is less hallucination-prone than medium on long meetings.
|
|
WHISPERX_BIN = os.environ.get("CHT_WHISPERX_BIN", "/home/mariano/wdir/venv/def/bin/whisperx")
|
|
WHISPERX_MODEL = os.environ.get("CHT_WHISPERX_MODEL", "large-v3")
|
|
WHISPERX_DEVICE = os.environ.get("CHT_WHISPERX_DEVICE", "cuda")
|
|
WHISPERX_COMPUTE_TYPE = os.environ.get("CHT_WHISPERX_COMPUTE_TYPE", "int8")
|
|
WHISPERX_BATCH_SIZE = int(os.environ.get("CHT_WHISPERX_BATCH_SIZE", "4"))
|
|
HF_TOKEN = os.environ.get("HF_TOKEN") # required for pyannote diarization
|
|
DEFAULT_PARTICIPANTS = 2
|
|
WHISPERX_LD_LIBRARY_PATH = os.environ.get("CHT_WHISPERX_LD_LIBRARY_PATH") # cuDNN override
|