Files
2026-09-21 21:44:00 +02:00

35 lines
1.2 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# Usage: ./run.sh [javis-slave args]
# JAVIS_SLAVE_HEADLESS=1 ./run.sh --headless # skip the Qt/PySide6 install (Pi without display)
# JAVIS_SLAVE_VAD=1 ./run.sh # also install silero-vad (+ PyTorch)
set -euo pipefail
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
if [[ ! -x ".venv/bin/python" ]]; then
if ! command -v python3 >/dev/null 2>&1; then
echo "Error: python3 is required." >&2
exit 1
fi
python_version="$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')"
case "$python_version" in
3.10|3.11|3.12|3.13) ;;
*) echo "Error: javis-slave requires Python 3.10–3.13 (found $python_version)." >&2; exit 1 ;;
esac
extras=""
if [[ "${JAVIS_SLAVE_HEADLESS:-0}" != "1" ]]; then extras="gui"; fi
if [[ "${JAVIS_SLAVE_VAD:-0}" == "1" ]]; then extras="${extras:+$extras,}vad"; fi
echo "Creating virtual environment (extras: ${extras:-none})..."
python3 -m venv .venv
.venv/bin/python -m pip install --upgrade pip
if [[ -n "$extras" ]]; then
.venv/bin/python -m pip install -e ".[${extras}]"
else
.venv/bin/python -m pip install -e .
fi
fi
exec .venv/bin/python -m javis_slave "$@"