#!/usr/bin/env bash set -euo pipefail INSTALL_DIR="${1:-$HOME/pyannote-diarization-3.1-mlx-test}" INSTALL_DIR="${INSTALL_DIR/#\~/$HOME}" HTTPS_SPEC="pyannote-speaker-diarization-3.1-mlx @ git+https://gitea.tavportal.com/olivier/pyannote-speaker-diarization-3.1-mlx.git" SSH_SPEC="git+ssh://git@gitea.tavportal.com/olivier/pyannote-speaker-diarization-3.1-mlx.git" usage() { cat </dev/null 2>&1; then cat >&2 <<'EOF' uv is required but was not found. Install it with: curl -LsSf https://astral.sh/uv/install.sh | sh Then restart your shell and run this script again. EOF exit 1 fi mkdir -p "$INSTALL_DIR" cd "$INSTALL_DIR" if [[ ! -f pyproject.toml ]]; then uv init --python 3.12 else echo "Found existing pyproject.toml in $INSTALL_DIR; skipping uv init." fi echo "Installing from HTTPS..." if ! uv add "$HTTPS_SPEC"; then echo "HTTPS install failed; falling back to SSH pip install..." uv pip install "$SSH_SPEC" fi uv run python -c "from pyannote_diarization_3_1_mlx import MlxDiarizationPipeline; print('OK')"