#!/usr/bin/env bash set -euo pipefail assistant_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" assistant_src="$assistant_root/src" lab_root=/opt/git-projekts/meeting-lab north_venv=/opt/git-projekts/meeting-assistant/.venv whisper_executable=/home/martin/whisper.cpp/whisper.cpp/build/bin/whisper-cli whisper_model=/home/martin/whisper.cpp/whisper.cpp/models/ggml-large-v3-turbo.bin require_directory() { if [[ ! -d "$1" ]]; then printf 'Required directory is missing: %s\n' "$1" >&2 exit 1 fi } require_file() { if [[ ! -f "$1" ]]; then printf 'Required file is missing: %s\n' "$1" >&2 exit 1 fi } require_executable() { if [[ ! -x "$1" ]]; then printf 'Required executable is missing or not executable: %s\n' "$1" >&2 exit 1 fi } require_directory "$assistant_src" require_file "$assistant_src/mka/ui/streamlit_app.py" require_directory "$lab_root" require_file "$lab_root/src/meeting_lab/__init__.py" require_directory "$north_venv" require_executable "$north_venv/bin/streamlit" require_executable "$whisper_executable" require_file "$whisper_model" if ! command -v docker >/dev/null 2>&1; then printf 'Required executable is not on PATH: docker\n' >&2 exit 1 fi export MKA_WHISPER_EXECUTABLE="$whisper_executable" export MKA_WHISPER_MODEL="$whisper_model" export MKA_PROTOCOL_MODEL=qwen3.8:27b export MKA_OLLAMA_ENDPOINT=http://127.0.0.1:11434 export MKA_DIARIZATION_MODE=auto export MKA_DIARIZATION_RUNTIME=container export MKA_DIARIZATION_CONTAINER_IMAGE=rocm/pytorch:rocm7.2.1_ubuntu24.04_py3.12_pytorch_release_2.9.1 export MKA_DIARIZATION_CONTAINER_ARGS='["--device=/dev/kfd","--device=/dev/dri","--group-add","video"]' # Keep feature sources ahead of the reused venv's editable installations. export PYTHONPATH="$assistant_src:$lab_root" exec "$north_venv/bin/streamlit" run "$assistant_src/mka/ui/streamlit_app.py"